1111from homeassistant .const import (
1212 ATTR_BATTERY_LEVEL ,
1313 PERCENTAGE ,
14+ SIGNAL_STRENGTH_DECIBELS_MILLIWATT ,
1415 EntityCategory ,
1516 UnitOfTemperature ,
1617)
@@ -121,11 +122,20 @@ class BHyveSensorEntityDescription(SensorEntityDescription):
121122 ),
122123 attributes_fn = lambda data : {
123124 "location" : data .get ("location_name" ),
124- "rssi" : data .get ("status" , {}).get ("rssi" ),
125- "temperature_alarm" : data .get ("status" , {}).get ("temp_alarm_status" ),
126125 },
127126 available_fn = lambda _data , value : value is not None ,
128127 ),
128+ BHyveSensorEntityDescription (
129+ key = "rssi" ,
130+ translation_key = "signal_strength" ,
131+ name = "Signal strength" ,
132+ unique_id_suffix = "rssi" ,
133+ device_class = SensorDeviceClass .SIGNAL_STRENGTH ,
134+ state_class = SensorStateClass .MEASUREMENT ,
135+ native_unit_of_measurement = SIGNAL_STRENGTH_DECIBELS_MILLIWATT ,
136+ entity_category = EntityCategory .DIAGNOSTIC ,
137+ value_fn = lambda data : data .get ("status" , {}).get ("rssi" ),
138+ ),
129139)
130140
131141SENSOR_TYPES_BATTERY : tuple [BHyveSensorEntityDescription , ...] = (
@@ -232,7 +242,7 @@ async def async_setup_entry(
232242 sensors .append (BHyveSensor (coordinator , device , description ))
233243
234244 if device .get ("type" ) == DEVICE_FLOOD :
235- # Add temperature sensor
245+ # Add temperature and RSSI sensors
236246 for base_description in SENSOR_TYPES_FLOOD :
237247 description = BHyveSensorEntityDescription (
238248 key = base_description .key ,
@@ -243,6 +253,7 @@ async def async_setup_entry(
243253 device_class = base_description .device_class ,
244254 state_class = base_description .state_class ,
245255 native_unit_of_measurement = base_description .native_unit_of_measurement ,
256+ entity_category = base_description .entity_category ,
246257 value_fn = base_description .value_fn ,
247258 attributes_fn = base_description .attributes_fn ,
248259 icon_fn = base_description .icon_fn ,
0 commit comments