File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
custom_components/luxtronik Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -186,15 +186,16 @@ def _handle_coordinator_update(self, force: bool = False) -> None:
186186
187187 def compute_is_on (self , state : Any ) -> bool :
188188 descr = self .entity_description
189+
189190 if isinstance (descr .on_state , bool ) and state is not None :
190191 state = bool (state )
191- return (
192- state != descr .on_state
193- if descr .inverted
194- else state == descr .on_state
195- or (descr .on_states and state in descr .on_states )
192+
193+ is_on = bool (
194+ state == descr .on_state or (descr .on_states and state in descr .on_states )
196195 )
197196
197+ return not is_on if descr .inverted else is_on
198+
198199 def _enrich_extra_attributes (self ) -> None :
199200 for attr in self .entity_description .extra_attributes :
200201 if attr .format is None and (
You can’t perform that action at this time.
0 commit comments