From 79bcdf43f7d6e472cac80c2128c00228c5dd7095 Mon Sep 17 00:00:00 2001 From: Maciej Bieniek Date: Wed, 1 Mar 2023 16:26:20 +0100 Subject: [PATCH] Add `current` sensor for Shelly RPC devices (#88863) --- homeassistant/components/shelly/sensor.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/homeassistant/components/shelly/sensor.py b/homeassistant/components/shelly/sensor.py index 2737270ac76..5e05134fdc3 100644 --- a/homeassistant/components/shelly/sensor.py +++ b/homeassistant/components/shelly/sensor.py @@ -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",