prettier names
This commit is contained in:
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,
|
||||
|
||||
@@ -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([
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user