Loading codes/climate/6285.json 0 → 100644 +463 −0 File added.Preview size limit exceeded, changes collapsed. Show changes custom_components/smartir/controller.py +18 −2 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ from base64 import b64encode import binascii import requests import logging import json from homeassistant.const import ATTR_ENTITY_ID from . import Helper Loading @@ -12,6 +13,7 @@ BROADLINK_CONTROLLER = 'Broadlink' XIAOMI_CONTROLLER = 'Xiaomi' MQTT_CONTROLLER = 'MQTT' LOOKIN_CONTROLLER = 'LOOKin' ESPHOME_CONTROLLER = 'ESPHome' ENC_BASE64 = 'Base64' ENC_HEX = 'Hex' Loading @@ -22,12 +24,13 @@ BROADLINK_COMMANDS_ENCODING = [ENC_BASE64, ENC_HEX, ENC_PRONTO] XIAOMI_COMMANDS_ENCODING = [ENC_PRONTO, ENC_RAW] MQTT_COMMANDS_ENCODING = [ENC_RAW] LOOKIN_COMMANDS_ENCODING = [ENC_PRONTO, ENC_RAW] ESPHOME_COMMANDS_ENCODING = [ENC_RAW] class Controller(): def __init__(self, hass, controller, encoding, controller_data): if controller not in [ BROADLINK_CONTROLLER, XIAOMI_CONTROLLER, MQTT_CONTROLLER, LOOKIN_CONTROLLER]: MQTT_CONTROLLER, LOOKIN_CONTROLLER, ESPHOME_CONTROLLER]: raise Exception("The controller is not supported.") if controller == BROADLINK_CONTROLLER: Loading @@ -50,6 +53,11 @@ class Controller(): raise Exception("The encoding is not supported " "by the LOOKin controller.") if controller == ESPHOME_CONTROLLER: if encoding not in ESPHOME_COMMANDS_ENCODING: raise Exception("The encoding is not supported " "by the ESPHome controller.") self.hass = hass self._controller = controller self._encoding = encoding Loading Loading @@ -111,3 +119,11 @@ class Controller(): await self.hass.async_add_executor_job( requests.get, url ) if self._controller == ESPHOME_CONTROLLER: service_data = { 'command': json.loads(command) } await self.hass.services.async_call( 'esphome', self._controller_data, service_data) docs/CLIMATE.md +1 −0 Original line number Diff line number Diff line Loading @@ -197,6 +197,7 @@ Below are the code files created by the people in the community. Before you star | [1284](../codes/climate/1284.json) | AR-REG1U (Remote control) | Broadlink | | [1285](../codes/climate/1285.json) | AR-RCE1E (Remote control) | Broadlink | | [3285](../codes/climate/3285.json) | AR-RCE1E (Remote control) | Xiaomi | | [6285](../codes/climate/6285.json) | AR-RCE1E (Remote control) | ESPHome | | [1286](../codes/climate/1286.json) | AR-JE5 (Remote control) | Broadlink | | [1287](../codes/climate/1287.json) | AR-REB1E (Remote control) | Broadlink | Loading info.md +11 −0 Original line number Diff line number Diff line Loading @@ -7,6 +7,17 @@ SmartIR is a custom integration for controlling AC units, TV sets and fans via I * [Xiaomi IR Remote (ChuangmiIr)](https://www.home-assistant.io/integrations/remote.xiaomi_miio/) * [LOOK.in Remote](http://look-in.club/devices/remote) * [MQTT Publish service](https://www.home-assistant.io/docs/mqtt/service/) * [ESPHome User-defined service for remote transmitter](https://esphome.io/components/api.html#user-defined-services) ```yml api: services: - service: send_raw_command variables: command: int[] then: - remote_transmitter.transmit_raw: code: !lambda 'return command;' ``` ## **Platform setup instructions** <p align="center"> Loading Loading
codes/climate/6285.json 0 → 100644 +463 −0 File added.Preview size limit exceeded, changes collapsed. Show changes
custom_components/smartir/controller.py +18 −2 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ from base64 import b64encode import binascii import requests import logging import json from homeassistant.const import ATTR_ENTITY_ID from . import Helper Loading @@ -12,6 +13,7 @@ BROADLINK_CONTROLLER = 'Broadlink' XIAOMI_CONTROLLER = 'Xiaomi' MQTT_CONTROLLER = 'MQTT' LOOKIN_CONTROLLER = 'LOOKin' ESPHOME_CONTROLLER = 'ESPHome' ENC_BASE64 = 'Base64' ENC_HEX = 'Hex' Loading @@ -22,12 +24,13 @@ BROADLINK_COMMANDS_ENCODING = [ENC_BASE64, ENC_HEX, ENC_PRONTO] XIAOMI_COMMANDS_ENCODING = [ENC_PRONTO, ENC_RAW] MQTT_COMMANDS_ENCODING = [ENC_RAW] LOOKIN_COMMANDS_ENCODING = [ENC_PRONTO, ENC_RAW] ESPHOME_COMMANDS_ENCODING = [ENC_RAW] class Controller(): def __init__(self, hass, controller, encoding, controller_data): if controller not in [ BROADLINK_CONTROLLER, XIAOMI_CONTROLLER, MQTT_CONTROLLER, LOOKIN_CONTROLLER]: MQTT_CONTROLLER, LOOKIN_CONTROLLER, ESPHOME_CONTROLLER]: raise Exception("The controller is not supported.") if controller == BROADLINK_CONTROLLER: Loading @@ -50,6 +53,11 @@ class Controller(): raise Exception("The encoding is not supported " "by the LOOKin controller.") if controller == ESPHOME_CONTROLLER: if encoding not in ESPHOME_COMMANDS_ENCODING: raise Exception("The encoding is not supported " "by the ESPHome controller.") self.hass = hass self._controller = controller self._encoding = encoding Loading Loading @@ -111,3 +119,11 @@ class Controller(): await self.hass.async_add_executor_job( requests.get, url ) if self._controller == ESPHOME_CONTROLLER: service_data = { 'command': json.loads(command) } await self.hass.services.async_call( 'esphome', self._controller_data, service_data)
docs/CLIMATE.md +1 −0 Original line number Diff line number Diff line Loading @@ -197,6 +197,7 @@ Below are the code files created by the people in the community. Before you star | [1284](../codes/climate/1284.json) | AR-REG1U (Remote control) | Broadlink | | [1285](../codes/climate/1285.json) | AR-RCE1E (Remote control) | Broadlink | | [3285](../codes/climate/3285.json) | AR-RCE1E (Remote control) | Xiaomi | | [6285](../codes/climate/6285.json) | AR-RCE1E (Remote control) | ESPHome | | [1286](../codes/climate/1286.json) | AR-JE5 (Remote control) | Broadlink | | [1287](../codes/climate/1287.json) | AR-REB1E (Remote control) | Broadlink | Loading
info.md +11 −0 Original line number Diff line number Diff line Loading @@ -7,6 +7,17 @@ SmartIR is a custom integration for controlling AC units, TV sets and fans via I * [Xiaomi IR Remote (ChuangmiIr)](https://www.home-assistant.io/integrations/remote.xiaomi_miio/) * [LOOK.in Remote](http://look-in.club/devices/remote) * [MQTT Publish service](https://www.home-assistant.io/docs/mqtt/service/) * [ESPHome User-defined service for remote transmitter](https://esphome.io/components/api.html#user-defined-services) ```yml api: services: - service: send_raw_command variables: command: int[] then: - remote_transmitter.transmit_raw: code: !lambda 'return command;' ``` ## **Platform setup instructions** <p align="center"> Loading