File tree Expand file tree Collapse file tree 2 files changed +3
-0
lines changed
custom_components/battery_notes Expand file tree Collapse file tree 2 files changed +3
-0
lines changed Original file line number Diff line number Diff line change 6969 ATTR_BATTERY_LAST_REPORTED ,
7070 ATTR_BATTERY_LAST_REPORTED_LEVEL ,
7171 ATTR_DEVICE_ID ,
72+ ATTR_DEVICE_NAME ,
7273)
7374
7475from .common import isfloat
@@ -492,6 +493,7 @@ def extra_state_attributes(self) -> dict[str, str] | None:
492493
493494 # Other attributes that should follow battery, attribute list is unsorted
494495 attrs [ATTR_DEVICE_ID ] = self .coordinator .device_id
496+ attrs [ATTR_DEVICE_NAME ] = self .coordinator .device_name
495497
496498 super_attrs = super ().extra_state_attributes
497499 if super_attrs :
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ See how to use this entity in the [community contributions](./community.md)
2222| ` battery_last_reported ` | ` datetime ` | The datetime when the battery level was last reported |
2323| ` battery_last_reported_level ` | ` float ` | The level when the battery was last reported |
2424| ` device_id ` | ` string ` | The device_id of the device |
25+ | ` device_name ` | ` string ` | The name of the device |
2526
2627## Battery Type
2728` sensor.{{device_name}}_battery_type `
You can’t perform that action at this time.
0 commit comments