Add device_class for switches (#3096)

This commit is contained in:
Joakim Plate 2019-04-19 00:12:17 +02:00 committed by Paulus Schoutsen
parent a70d9195db
commit bdd8699709

View File

@ -46,6 +46,7 @@ hassAttributeUtil.DOMAIN_DEVICE_CLASS = {
"power", "power",
"signal_strength", "signal_strength",
], ],
switch: ["switch", "outlet"],
}; };
hassAttributeUtil.UNKNOWN_TYPE = "json"; hassAttributeUtil.UNKNOWN_TYPE = "json";
@ -88,7 +89,7 @@ hassAttributeUtil.LOGIC_STATE_ATTRIBUTES = hassAttributeUtil.LOGIC_STATE_ATTRIBU
type: "array", type: "array",
options: hassAttributeUtil.DOMAIN_DEVICE_CLASS, options: hassAttributeUtil.DOMAIN_DEVICE_CLASS,
description: "Device class", description: "Device class",
domains: ["binary_sensor", "cover", "sensor"], domains: ["binary_sensor", "cover", "sensor", "switch"],
}, },
hidden: { type: "boolean", description: "Hide from UI" }, hidden: { type: "boolean", description: "Hide from UI" },
assumed_state: { assumed_state: {