File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
custom_components/luxtronik Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -188,15 +188,18 @@ def _handle_coordinator_update(self, force: bool = False) -> None:
188188
189189 def compute_is_on (self , state : Any ) -> bool :
190190 descr = self .entity_description
191+
191192 if isinstance (descr .on_state , bool ) and state is not None :
192193 state = bool (state )
193- return (
194- state != descr .on_state
195- if descr .inverted
196- else state == descr .on_state
194+
195+ is_on = bool (
196+ state == descr .on_state
197197 or (descr .on_states and state in descr .on_states )
198198 )
199199
200+ return not is_on if descr .inverted else is_on
201+
202+
200203 def _enrich_extra_attributes (self ) -> None :
201204 for attr in self .entity_description .extra_attributes :
202205 if attr .format is None and (
You can’t perform that action at this time.
0 commit comments