4
0
Vassilis Panos 6 жил өмнө
parent
commit
63ac2d9a48

+ 1 - 1
custom_components/smartir/__init__.py

@@ -19,7 +19,7 @@ from homeassistant.helpers.typing import ConfigType
 _LOGGER = logging.getLogger(__name__)
 
 DOMAIN = 'smartir'
-VERSION = '1.7.5'
+VERSION = '1.8.0'
 MANIFEST_URL = (
     "https://raw.githubusercontent.com/"
     "smartHomeHub/SmartIR/{}/"

+ 5 - 4
custom_components/smartir/controller.py

@@ -18,18 +18,18 @@ LOOKIN_CONTROLLER = 'LOOKin'
 ENC_BASE64 = 'Base64'
 ENC_HEX = 'Hex'
 ENC_PRONTO = 'Pronto'
-ENC_PRONTO_HEX = 'ProntoHex'
 ENC_RAW = 'Raw'
 
 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_HEX, ENC_RAW]
+LOOKIN_COMMANDS_ENCODING = [ENC_PRONTO, ENC_RAW]
 
 class Controller():
     def __init__(self, hass, controller, encoding, controller_data):
         if controller not in [
-            BROADLINK_CONTROLLER, XIAOMI_CONTROLLER, MQTT_CONTROLLER]:
+            BROADLINK_CONTROLLER, XIAOMI_CONTROLLER, 
+            MQTT_CONTROLLER, LOOKIN_CONTROLLER]:
             raise Exception("The controller is not supported.")
 
         if controller == BROADLINK_CONTROLLER:
@@ -107,8 +107,9 @@ class Controller():
                'mqtt', 'publish', service_data)
 
         if self._controller == LOOKIN_CONTROLLER:
+            encoding = self._encoding.lower().replace('pronto', 'prontohex')
             url = f"http://{self._controller_data}/commands/ir/" \
-                  f"{self._encoding.lower()}/{command}"
+                  f"{encoding}/{command}"
             await self.hass.async_add_executor_job(
                 requests.get, url
             )

+ 2 - 2
custom_components/smartir/manifest.json

@@ -7,8 +7,8 @@
   "requirements": ["aiofiles==0.5.0"],
   "homeassistant": "0.96.0",
   "updater": {
-    "version": "1.7.5",
-    "releaseNotes": "-- Fix doing I/O",
+    "version": "1.8.0",
+    "releaseNotes": "-- Adds support for LOOKin IR controller",
     "files": [
       "__init__.py",
       "climate.py",