mini sequence diagram
This commit is contained in:
1 parent
69edca7685
commit
e83e074fe8
2 files changed
+162
-20
No files matched your search
@@ -17,12 +17,13 @@ export default {
|
||||
}
|
||||
} as ComponentMeta<typeof SequenceNodes>
|
||||
|
||||
export const Simple: ComponentStory<typeof SequenceNodes> = args => <SVGBoard>
|
||||
const Template: ComponentStory<typeof SequenceNodes> = args => <SVGBoard>
|
||||
<SequenceNodes
|
||||
{...args}
|
||||
/>
|
||||
</SVGBoard>
|
||||
|
||||
export const Simple = Template.bind({})
|
||||
Simple.args = {
|
||||
...Simple.args,
|
||||
sequence: [
|
||||
@@ -66,3 +67,104 @@ Simple.args = {
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
export const Multinode = Template.bind({})
|
||||
Multinode.args = {
|
||||
...Multinode.args,
|
||||
startLoc: [0,0],
|
||||
sequence: [
|
||||
{
|
||||
$smType: "condition",
|
||||
condition: 'and',
|
||||
condition_data: {
|
||||
conditions: [
|
||||
{
|
||||
$smType: 'condition',
|
||||
condition: 'numeric_state',
|
||||
condition_data: {
|
||||
entity_id: 'sensor.temperature_kitchen',
|
||||
below: '15',
|
||||
}
|
||||
},
|
||||
{
|
||||
$smType: "condition",
|
||||
condition: 'template',
|
||||
condition_data: {
|
||||
value_template: 'states(switch.kitchen_light) == "on"'
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
$smType: "action",
|
||||
action: "choose",
|
||||
action_data: {
|
||||
choose: [
|
||||
{
|
||||
conditions: [
|
||||
{
|
||||
$smType: "condition",
|
||||
condition: 'time',
|
||||
condition_data: {
|
||||
after: {
|
||||
hours: 16,
|
||||
minutes: 30
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
sequence: [
|
||||
{
|
||||
$smType: 'action',
|
||||
action: 'event',
|
||||
action_data: {
|
||||
event: "superImportant_time",
|
||||
event_data: {
|
||||
time: '4:30PM'
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
conditions: [
|
||||
{
|
||||
$smType: "condition",
|
||||
condition: 'time',
|
||||
condition_data: {
|
||||
after: {
|
||||
hours: 18,
|
||||
minutes: 45
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
sequence: [
|
||||
{
|
||||
$smType: 'action',
|
||||
action: 'event',
|
||||
action_data: {
|
||||
event: "superImportant_time",
|
||||
event_data: {
|
||||
time: '6:45PM'
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
$smType: 'action',
|
||||
action: "service",
|
||||
action_data: {
|
||||
service: "light.turn_on",
|
||||
data: {
|
||||
entity_id: "light.kitchen"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in new issue
Block a user