Unverified Commit 49cbbb09 authored by Vassilis Panos's avatar Vassilis Panos Committed by GitHub
Browse files

Wrong power state fixed

parent f105640f
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -400,14 +400,16 @@ class SmartIRClimate(ClimateDevice, RestoreEntity):
        if new_state is None:
            return

        if new_state.state == STATE_OFF and self._current_operation != STATE_OFF:
            self._current_operation = STATE_OFF
            await self.async_update_ha_state()

        if new_state.state == STATE_ON and self._current_operation == STATE_OFF:
            self._on_by_remote = True
            await self.async_update_ha_state()

        if new_state.state == STATE_OFF:
            self._on_by_remote = False
            if self._current_operation != STATE_OFF:
                self._current_operation = STATE_OFF
            await self.async_update_ha_state()

    @callback
    def _async_update_temp(self, state):
        """Update thermostat with latest state from temperature sensor."""