Add `current` sensor for Shelly RPC devices (#88863)

pull/88977/head
Maciej Bieniek 2023-03-01 16:26:20 +01:00 committed by GitHub
parent b84eead3f8
commit 79bcdf43f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -439,6 +439,16 @@ RPC_SENSORS: Final = {
state_class=SensorStateClass.MEASUREMENT,
entity_registry_enabled_default=False,
),
"current": RpcSensorDescription(
key="switch",
sub_key="current",
name="Current",
native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
value=lambda status, _: None if status is None else float(status),
device_class=SensorDeviceClass.CURRENT,
state_class=SensorStateClass.MEASUREMENT,
entity_registry_enabled_default=False,
),
"a_current": RpcSensorDescription(
key="em",
sub_key="a_current",