@@ -115,9 +115,9 @@ async def async_add_binary_sensor(key, device_model, firmware, auto_sensors, man
115
115
if key not in sensors_by_key :
116
116
sensors_by_key [key ] = {}
117
117
if measurement not in sensors_by_key [key ]:
118
- description = [item for item in BINARY_SENSOR_TYPES if item .key is measurement ][0 ]
119
- sensors [measurement ] = globals ()[description .sensor_class ](
120
- self .config , key , device_model , firmware , description , manufacturer
118
+ entity_description = [item for item in BINARY_SENSOR_TYPES if item .key is measurement ][0 ]
119
+ sensors [measurement ] = globals ()[entity_description .sensor_class ](
120
+ self .config , key , device_model , firmware , entity_description , manufacturer
121
121
)
122
122
self .add_entities ([sensors [measurement ]])
123
123
sensors_by_key [key ].update (sensors )
@@ -129,9 +129,9 @@ async def async_add_binary_sensor(key, device_model, firmware, auto_sensors, man
129
129
sensors = {}
130
130
sensors_by_key [key ] = {}
131
131
for measurement in device_sensors :
132
- description = [item for item in BINARY_SENSOR_TYPES if item .key is measurement ][0 ]
133
- sensors [measurement ] = globals ()[description .sensor_class ](
134
- self .config , key , device_model , firmware , description , manufacturer
132
+ entity_description = [item for item in BINARY_SENSOR_TYPES if item .key is measurement ][0 ]
133
+ sensors [measurement ] = globals ()[entity_description .sensor_class ](
134
+ self .config , key , device_model , firmware , entity_description , manufacturer
135
135
)
136
136
self .add_entities ([sensors [measurement ]])
137
137
sensors_by_key [key ] = sensors
@@ -288,11 +288,11 @@ def __init__(
288
288
key : str ,
289
289
devtype : str ,
290
290
firmware : str ,
291
- description : BLEMonitorBinarySensorEntityDescription ,
291
+ entity_description : BLEMonitorBinarySensorEntityDescription ,
292
292
manufacturer = None
293
293
) -> None :
294
294
"""Initialize the binary sensor."""
295
- self .entity_description = description
295
+ self .entity_description = entity_description
296
296
self ._config = config
297
297
self ._type = detect_conf_type (key )
298
298
@@ -321,10 +321,10 @@ def __init__(
321
321
self ._reset_timer = self ._device_settings ["reset_timer" ]
322
322
self ._newstate = None
323
323
324
- self ._attr_name = f"{ description .name } { self ._device_name } "
325
- self ._attr_unique_id = f"{ description .unique_id } { self ._device_name } "
324
+ self ._attr_name = f"{ self . entity_description .name } { self ._device_name } "
325
+ self ._attr_unique_id = f"{ self . entity_description .unique_id } { self ._device_name } "
326
326
self ._attr_should_poll = False
327
- self ._attr_force_update = description .force_update
327
+ self ._attr_force_update = self . entity_description .force_update
328
328
self ._attr_extra_state_attributes = self ._extra_state_attributes
329
329
330
330
self ._attr_device_info = {
@@ -512,9 +512,9 @@ async def async_update(self):
512
512
class MotionBinarySensor (BaseBinarySensor ):
513
513
"""Representation of a Motion Binary Sensor."""
514
514
515
- def __init__ (self , config , key , devtype , firmware , description , manufacturer = None ):
515
+ def __init__ (self , config , key , devtype , firmware , entity_description , manufacturer = None ):
516
516
"""Initialize the sensor."""
517
- super ().__init__ (config , key , devtype , firmware , description , manufacturer )
517
+ super ().__init__ (config , key , devtype , firmware , entity_description , manufacturer )
518
518
self ._start_timer = None
519
519
520
520
def reset_state (self , event = None ):
0 commit comments