Add removal condition to Shelly battery sensor (#113703)

Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
pull/113714/head
Maciej Bieniek 2024-03-17 21:21:42 +01:00 committed by GitHub
parent 4d75940cd2
commit d8f74571a1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 0 deletions

View File

@ -942,6 +942,7 @@ RPC_SENSORS: Final = {
device_class=SensorDeviceClass.BATTERY,
state_class=SensorStateClass.MEASUREMENT,
entity_category=EntityCategory.DIAGNOSTIC,
removal_condition=lambda _config, status, key: (status[key]["battery"] is None),
),
"voltmeter": RpcSensorDescription(
key="voltmeter",