Commit 02b75542 authored by Vassilis Panos's avatar Vassilis Panos
Browse files

Adds support to climate for independent ON command

parent 0896e4d0
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.10.0'
VERSION = '1.11.0'
MANIFEST_URL = (
    "https://raw.githubusercontent.com/"
    "smartHomeHub/SmartIR/{}/"
+15 −10
Original line number Diff line number Diff line
@@ -320,18 +320,23 @@ class SmartIRClimate(ClimateEntity, RestoreEntity):

    async def send_command(self):
        async with self._temp_lock:
            try:
                self._on_by_remote = False
                operation_mode = self._hvac_mode
                fan_mode = self._current_fan_mode
                target_temperature = '{0:g}'.format(self._target_temperature)

                if operation_mode.lower() == HVAC_MODE_OFF:
                command = self._commands['off']
            else:
                command = self._commands[operation_mode][fan_mode][target_temperature]
                    await self._controller.send(self._commands['off'])
                    return

                if 'on' in self._commands:
                    await self._controller.send(self._commands['on'])
                    await asyncio.sleep(0.5)

                await self._controller.send(
                    self._commands[operation_mode][fan_mode][target_temperature])

            try:
                await self._controller.send(command)
            except Exception as e:
                _LOGGER.exception(e)
            
+2 −0
Original line number Diff line number Diff line
[![hacs_badge](https://img.shields.io/badge/HACS-Custom-orange.svg)](https://github.com/custom-components/hacs)

[![buy me a coffee](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/vassilis)

SmartIR is a custom [Home Assistant](https://www.home-assistant.io/) component for controlling AC units, TV sets and fans via Infrared and RF controllers. An IR or RF controller such as Broadlink is required.

The key features of the component are: