File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
custom_components/battery_notes Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -202,7 +202,11 @@ def battery_low_binary_state(self):
202202 def battery_low_binary_state (self , value ):
203203 """Set the current battery low status from a binary sensor and fire events if valid."""
204204 self ._battery_low_binary_state = value
205- if self ._previous_battery_low_binary_state is not None :
205+ if (self ._previous_battery_low_binary_state is not None
206+ and value not in [
207+ STATE_UNAVAILABLE ,
208+ STATE_UNKNOWN ,
209+ ]):
206210 self .hass .bus .async_fire (
207211 EVENT_BATTERY_THRESHOLD ,
208212 {
@@ -229,6 +233,10 @@ def battery_low_binary_state(self, value):
229233 if (
230234 self ._previous_battery_low_binary_state
231235 and not self ._battery_low_binary_state
236+ and value not in [
237+ STATE_UNAVAILABLE ,
238+ STATE_UNKNOWN ,
239+ ]
232240 ):
233241 self .hass .bus .async_fire (
234242 EVENT_BATTERY_INCREASED ,
You can’t perform that action at this time.
0 commit comments