Fix wifi sensor units in Blink (#107539)

This commit is contained in:
mkmer 2024-01-14 04:59:04 -05:00 committed by GitHub
parent 51cdb4ce36
commit e12dcfc1b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 10 deletions

View file

@ -10,11 +10,7 @@ from homeassistant.components.sensor import (
SensorStateClass,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
SIGNAL_STRENGTH_DECIBELS_MILLIWATT,
EntityCategory,
UnitOfTemperature,
)
from homeassistant.const import EntityCategory, UnitOfTemperature
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.device_registry import DeviceInfo
from homeassistant.helpers.entity_platform import AddEntitiesCallback
@ -35,9 +31,8 @@ SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
),
SensorEntityDescription(
key=TYPE_WIFI_STRENGTH,
translation_key="wifi_rssi",
native_unit_of_measurement=SIGNAL_STRENGTH_DECIBELS_MILLIWATT,
device_class=SensorDeviceClass.SIGNAL_STRENGTH,
translation_key="wifi_strength",
icon="mdi:wifi",
entity_category=EntityCategory.DIAGNOSTIC,
state_class=SensorStateClass.MEASUREMENT,
),

View file

@ -39,8 +39,8 @@
},
"entity": {
"sensor": {
"wifi_rssi": {
"name": "Wi-Fi RSSI"
"wifi_strength": {
"name": "Wi-Fi signal strength"
}
},
"binary_sensor": {