prettier names

This commit is contained in:
ari committed 2022-06-17 14:34:37 -04:00
1 parent 0c9b0ec6e6
commit 0b183353d3
3 files changed
+15 -7

No files matched your search

@@ -66,7 +66,7 @@ export const ActionDeviceState: OptionManager<DeviceAction> = {
<InputText
key={"extra" + state.device_id + field.name}
label={prettyName(field.name)}
value={state[field.name] ?? ""}
value={(state as any)[field.name] ?? ""}
onChange={(v) =>
update({
[field.name]: v,
-1
View File
@@ -60,7 +60,6 @@ export const DeviceAction = st.intersection([
entity_id: st.optional(st.string()),
domain: st.optional(st.string()),
}),
st.record(st.string(), st.any()),
]);
export const ChooseAction = st.intersection([
+14 -5
View File
@@ -58,11 +58,20 @@ export const getDescriptionFromAutomationNode = <N extends AutomationNodeTypes>(
return out;
}
if (node.platform === "device") {
return node.device_id
? namer.getDeviceName(node.device_id)
: node.entity_id
? namer.getEntityName(node.entity_id)
: node.platform;
let out = "";
if (node.device_id) {
out = namer.getDeviceName(node.device_id);
}
if (!out && node.entity_id) {
out = namer.getEntityName(node.entity_id);
}
if (node.type) {
out += node.type;
}
if (!out) {
out = node.platform;
}
return out;
}
return node.platform;
}