Commit 1ad385e7 authored by Vassilis Panos's avatar Vassilis Panos
Browse files

Fixes power_sensor

parent 40973e4a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@ from homeassistant.helpers.typing import ConfigType
_LOGGER = logging.getLogger(__name__)

DOMAIN = 'smartir'
VERSION = '1.14.0'
VERSION = '1.14.1'
MANIFEST_URL = (
    "https://raw.githubusercontent.com/"
    "smartHomeHub/SmartIR/{}/"
+6 −3
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@ from homeassistant.components.climate.const import (
    SUPPORT_TARGET_TEMPERATURE, SUPPORT_FAN_MODE,
    HVAC_MODES, ATTR_HVAC_MODE)
from homeassistant.const import (
    CONF_NAME, STATE_ON, STATE_UNKNOWN, ATTR_TEMPERATURE,
    CONF_NAME, STATE_ON, STATE_OFF, STATE_UNKNOWN, ATTR_TEMPERATURE,
    PRECISION_TENTHS, PRECISION_HALVES, PRECISION_WHOLE)
from homeassistant.core import callback
from homeassistant.helpers.event import async_track_state_change
@@ -261,7 +261,7 @@ class SmartIRClimate(ClimateEntity, RestoreEntity):
            'manufacturer': self._manufacturer,
            'supported_models': self._supported_models,
            'supported_controller': self._supported_controller,
            'commands_encoding': self._commands_encoding,
            'commands_encoding': self._commands_encoding
        }

    async def async_set_temperature(self, **kwargs):
@@ -362,6 +362,9 @@ class SmartIRClimate(ClimateEntity, RestoreEntity):
        if new_state is None:
            return

        if new_state.state == old_state.state:
            return

        if new_state.state == STATE_ON and self._hvac_mode == HVAC_MODE_OFF:
            self._on_by_remote = True
            if self._power_sensor_restore_state == True and self._last_on_operation is not None:
@@ -371,7 +374,7 @@ class SmartIRClimate(ClimateEntity, RestoreEntity):

            await self.async_update_ha_state()

        if new_state.state == HVAC_MODE_OFF:
        if new_state.state == STATE_OFF:
            self._on_by_remote = False
            if self._hvac_mode != HVAC_MODE_OFF:
                self._hvac_mode = HVAC_MODE_OFF
+2 −2
Original line number Diff line number Diff line
@@ -7,8 +7,8 @@
  "requirements": ["aiofiles==0.5.0"],
  "homeassistant": "0.115.0",
  "updater": {
    "version": "1.14.0",
    "releaseNotes": "-- Adds power_sensor_restore_state",
    "version": "1.14.1",
    "releaseNotes": "-- Fixes power_sensor",
    "files": [
      "__init__.py",
      "climate.py",