Enable statistics for WLED WiFi RSSI/Signal sensors (#76789)

pull/76754/head
Álvaro Fernández Rojas 2022-08-15 11:49:22 +02:00 committed by GitHub
parent 8f0f734c28
commit f443edfef4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -96,6 +96,7 @@ SENSORS: tuple[WLEDSensorEntityDescription, ...] = (
name="Wi-Fi signal",
icon="mdi:wifi",
native_unit_of_measurement=PERCENTAGE,
state_class=SensorStateClass.MEASUREMENT,
entity_category=EntityCategory.DIAGNOSTIC,
entity_registry_enabled_default=False,
value_fn=lambda device: device.info.wifi.signal if device.info.wifi else None,
@ -105,6 +106,7 @@ SENSORS: tuple[WLEDSensorEntityDescription, ...] = (
name="Wi-Fi RSSI",
native_unit_of_measurement=SIGNAL_STRENGTH_DECIBELS_MILLIWATT,
device_class=SensorDeviceClass.SIGNAL_STRENGTH,
state_class=SensorStateClass.MEASUREMENT,
entity_category=EntityCategory.DIAGNOSTIC,
entity_registry_enabled_default=False,
value_fn=lambda device: device.info.wifi.rssi if device.info.wifi else None,