diff --git a/custom_components/battery_notes/coordinator.py b/custom_components/battery_notes/coordinator.py index 14139234..5ba600fa 100644 --- a/custom_components/battery_notes/coordinator.py +++ b/custom_components/battery_notes/coordinator.py @@ -22,6 +22,7 @@ ATTR_BATTERY_LAST_REPLACED, ATTR_BATTERY_LEVEL, ATTR_BATTERY_LOW, + ATTR_BATTERY_LOW_THRESHOLD, ATTR_BATTERY_QUANTITY, ATTR_BATTERY_THRESHOLD_REMINDER, ATTR_BATTERY_TYPE, @@ -143,6 +144,7 @@ def battery_low_template_state(self, value): ATTR_SOURCE_ENTITY_ID: self.source_entity_id or "", ATTR_DEVICE_NAME: self.device_name, ATTR_BATTERY_LOW: self.battery_low, + ATTR_BATTERY_LOW_THRESHOLD: self.battery_low_threshold, ATTR_BATTERY_TYPE_AND_QUANTITY: self.battery_type_and_quantity, ATTR_BATTERY_TYPE: self.battery_type, ATTR_BATTERY_QUANTITY: self.battery_quantity, @@ -168,6 +170,7 @@ def battery_low_template_state(self, value): ATTR_SOURCE_ENTITY_ID: self.source_entity_id or "", ATTR_DEVICE_NAME: self.device_name, ATTR_BATTERY_LOW: self.battery_low, + ATTR_BATTERY_LOW_THRESHOLD: self.battery_low_threshold, ATTR_BATTERY_TYPE_AND_QUANTITY: self.battery_type_and_quantity, ATTR_BATTERY_TYPE: self.battery_type, ATTR_BATTERY_QUANTITY: self.battery_quantity, @@ -198,6 +201,7 @@ def battery_low_binary_state(self, value): ATTR_SOURCE_ENTITY_ID: self.source_entity_id or "", ATTR_DEVICE_NAME: self.device_name, ATTR_BATTERY_LOW: self.battery_low, + ATTR_BATTERY_LOW_THRESHOLD: self.battery_low_threshold, ATTR_BATTERY_TYPE_AND_QUANTITY: self.battery_type_and_quantity, ATTR_BATTERY_TYPE: self.battery_type, ATTR_BATTERY_QUANTITY: self.battery_quantity, @@ -224,6 +228,7 @@ def battery_low_binary_state(self, value): ATTR_SOURCE_ENTITY_ID: self.source_entity_id or "", ATTR_DEVICE_NAME: self.device_name, ATTR_BATTERY_LOW: self.battery_low, + ATTR_BATTERY_LOW_THRESHOLD: self.battery_low_threshold, ATTR_BATTERY_TYPE_AND_QUANTITY: self.battery_type_and_quantity, ATTR_BATTERY_TYPE: self.battery_type, ATTR_BATTERY_QUANTITY: self.battery_quantity, @@ -273,6 +278,7 @@ def current_battery_level(self, value): ATTR_SOURCE_ENTITY_ID: self.source_entity_id or "", ATTR_DEVICE_NAME: self.device_name, ATTR_BATTERY_LOW: self.battery_low, + ATTR_BATTERY_LOW_THRESHOLD: self.battery_low_threshold, ATTR_BATTERY_TYPE_AND_QUANTITY: self.battery_type_and_quantity, ATTR_BATTERY_TYPE: self.battery_type, ATTR_BATTERY_QUANTITY: self.battery_quantity, @@ -307,6 +313,7 @@ def current_battery_level(self, value): ATTR_SOURCE_ENTITY_ID: self.source_entity_id or "", ATTR_DEVICE_NAME: self.device_name, ATTR_BATTERY_LOW: self.battery_low, + ATTR_BATTERY_LOW_THRESHOLD: self.battery_low_threshold, ATTR_BATTERY_TYPE_AND_QUANTITY: self.battery_type_and_quantity, ATTR_BATTERY_TYPE: self.battery_type, ATTR_BATTERY_QUANTITY: self.battery_quantity, diff --git a/custom_components/battery_notes/services.py b/custom_components/battery_notes/services.py index e6a7f085..ccd59e47 100644 --- a/custom_components/battery_notes/services.py +++ b/custom_components/battery_notes/services.py @@ -20,6 +20,7 @@ ATTR_BATTERY_LAST_REPORTED_LEVEL, ATTR_BATTERY_LEVEL, ATTR_BATTERY_LOW, + ATTR_BATTERY_LOW_THRESHOLD, ATTR_BATTERY_QUANTITY, ATTR_BATTERY_THRESHOLD_REMINDER, ATTR_BATTERY_TYPE, @@ -220,6 +221,7 @@ async def handle_battery_low(call: ServiceCall) -> ServiceResponse: ATTR_SOURCE_ENTITY_ID: device.coordinator.source_entity_id or "", ATTR_BATTERY_LOW: device.coordinator.battery_low, + ATTR_BATTERY_LOW_THRESHOLD: device.coordinator.battery_low_threshold, ATTR_BATTERY_TYPE_AND_QUANTITY: device.coordinator.battery_type_and_quantity, ATTR_BATTERY_TYPE: device.coordinator.battery_type, ATTR_BATTERY_QUANTITY: device.coordinator.battery_quantity,