fixed device editor issue
This commit is contained in:
1 parent
13ea3632e3
commit
4f05e64652
2 files changed
+24
-4
No files matched your search
@@ -22,9 +22,17 @@ export default {
|
||||
} as ComponentMeta<typeof NodeEditor>;
|
||||
|
||||
const Base: ComponentStory<typeof NodeEditor> = (props) => {
|
||||
const [state, setState] = useState(props.node);
|
||||
return (
|
||||
<Page>
|
||||
<NodeEditor {...props} />
|
||||
<NodeEditor
|
||||
{...props}
|
||||
node={state}
|
||||
onSave={(s) => {
|
||||
setState(s);
|
||||
props.onSave && props.onSave(s);
|
||||
}}
|
||||
/>
|
||||
</Page>
|
||||
);
|
||||
};
|
||||
@@ -133,3 +141,15 @@ DeviceActionFilledExample.args = {
|
||||
device_id: "c9711be86b0301955f72380509285485",
|
||||
},
|
||||
};
|
||||
|
||||
export const NotifyPhoneViaDeviceAction = Action.bind({});
|
||||
NotifyPhoneViaDeviceAction.args = {
|
||||
...NotifyPhoneViaDeviceAction.args,
|
||||
node: {
|
||||
device_id: "2a98db84af7526c7ec3cc7aebd1a9e1c",
|
||||
domain: "mobile_app",
|
||||
type: "notify",
|
||||
title: "Hassio Status",
|
||||
message: "Hassio Is turning off...",
|
||||
} as any,
|
||||
};
|
||||
@@ -52,10 +52,10 @@ export const FireEventAction = st.intersection([
|
||||
}),
|
||||
]);
|
||||
|
||||
export const DeviceAction = st.intersection([
|
||||
export const DeviceAction = st.assign(
|
||||
AutomationActionNodeBase,
|
||||
st.partial(AutomationDeviceState),
|
||||
]);
|
||||
st.partial(AutomationDeviceState)
|
||||
);
|
||||
|
||||
export const ChooseAction = st.intersection([
|
||||
AutomationActionNodeBase,
|
||||
|
||||
Reference in new issue
Block a user