19
19
20
20
from .common import validate_is_float
21
21
from .const import (
22
+ ATTR_BATTERY_LAST_REPLACED ,
22
23
ATTR_BATTERY_LEVEL ,
23
24
ATTR_BATTERY_LOW ,
24
25
ATTR_BATTERY_QUANTITY ,
@@ -147,6 +148,7 @@ def battery_low_template_state(self, value):
147
148
ATTR_BATTERY_QUANTITY : self .battery_quantity ,
148
149
ATTR_BATTERY_LEVEL : 0 ,
149
150
ATTR_PREVIOUS_BATTERY_LEVEL : 100 ,
151
+ ATTR_BATTERY_LAST_REPLACED : self .last_replaced ,
150
152
ATTR_BATTERY_THRESHOLD_REMINDER : False ,
151
153
},
152
154
)
@@ -171,6 +173,7 @@ def battery_low_template_state(self, value):
171
173
ATTR_BATTERY_QUANTITY : self .battery_quantity ,
172
174
ATTR_BATTERY_LEVEL : 100 ,
173
175
ATTR_PREVIOUS_BATTERY_LEVEL : 0 ,
176
+ ATTR_BATTERY_LAST_REPLACED : self .last_replaced ,
174
177
},
175
178
)
176
179
@@ -200,6 +203,7 @@ def battery_low_binary_state(self, value):
200
203
ATTR_BATTERY_QUANTITY : self .battery_quantity ,
201
204
ATTR_BATTERY_LEVEL : 0 ,
202
205
ATTR_PREVIOUS_BATTERY_LEVEL : 100 ,
206
+ ATTR_BATTERY_LAST_REPLACED : self .last_replaced ,
203
207
ATTR_BATTERY_THRESHOLD_REMINDER : False ,
204
208
},
205
209
)
@@ -225,6 +229,7 @@ def battery_low_binary_state(self, value):
225
229
ATTR_BATTERY_QUANTITY : self .battery_quantity ,
226
230
ATTR_BATTERY_LEVEL : 100 ,
227
231
ATTR_PREVIOUS_BATTERY_LEVEL : 0 ,
232
+ ATTR_BATTERY_LAST_REPLACED : self .last_replaced ,
228
233
},
229
234
)
230
235
@@ -273,6 +278,7 @@ def current_battery_level(self, value):
273
278
ATTR_BATTERY_QUANTITY : self .battery_quantity ,
274
279
ATTR_BATTERY_LEVEL : self .rounded_battery_level ,
275
280
ATTR_PREVIOUS_BATTERY_LEVEL : self .rounded_previous_battery_level ,
281
+ ATTR_BATTERY_LAST_REPLACED : self .last_replaced ,
276
282
ATTR_BATTERY_THRESHOLD_REMINDER : False ,
277
283
},
278
284
)
@@ -306,6 +312,7 @@ def current_battery_level(self, value):
306
312
ATTR_BATTERY_QUANTITY : self .battery_quantity ,
307
313
ATTR_BATTERY_LEVEL : self .rounded_battery_level ,
308
314
ATTR_PREVIOUS_BATTERY_LEVEL : self .rounded_previous_battery_level ,
315
+ ATTR_BATTERY_LAST_REPLACED : self .last_replaced ,
309
316
},
310
317
)
311
318
0 commit comments