Sfoglia il codice sorgente

Merge pull request #355 from smartHomeHub/rc

1.11.0
Vassilis Panos 6 anni fa
parent
commit
ce43325237

+ 22 - 0
codes/media_player/1161.json

@@ -0,0 +1,22 @@
+{
+  "manufacturer":"Logitech",
+  "supportedModels":[
+    "Z-5500"
+  ],
+  "supportedController":"Broadlink",
+  "commandsEncoding":"Base64",
+  "commands":{
+    "off":"JgBYAAABKpIUEBUQFRAROBUQFRAVEBUQEjcVNRQ1FBAVNRI3EjcTNxITFBERExUQFTUSExAUFRAVNBM3EjcTNxITETgUNRQ2FAAFKQABJ0kTAAxXAAEnShIADQU=",
+    "on":"JgBYAAABKpIUEBUQFRAROBUQFRAVEBUQEjcVNRQ1FBAVNRI3EjcTNxITFBERExUQFTUSExAUFRAVNBM3EjcTNxITETgUNRQ2FAAFKQABJ0kTAAxXAAEnShIADQU=",
+    "previousChannel":"",
+    "nextChannel":"",
+    "volumeDown":"JgBYAAABJpYSExEUERQROREVERMSExEVETgRORI5EhISORI4ETkSOBITEjkROBE5EhQQFRISEhQROREUERQRFBE5EjgRORI5EQAFJAABJ0sSAAxhAAEnSxIADQU=",
+    "volumeUp":"JgBQAAABJ5YQFRETERYQORAVEBYQFRAVEDkQOhE6EBUQOhE5ETgSOREUEjkRExE5EjkQFREUEBUQOhAUETkSFBAVETgSOBE6EQAFJQABJ0sRAA0FAAAAAAAAAAA=",
+    "mute":"JgBYAAABJ5YRFBEUERQROREUERQRFBITETkSORE4ERURORA5EjkSOBEUETkRORITETkSExEVERMSORISEhQQORIUETkRORI4EQAFJQABJ0wRAAxgAAEnTBIADQU=",
+    "sources":{
+      "direct":"JgBgAAABKJUSExEUERQSOBEUEhMSExEUEjgRORI5EhISORI4ETkRORITETkSExI5ERMSExEVERMSORISEjkSExE5EjgRORE5EgAFJAABKEoSAAxhAAEmTBEADGEAAShKEgANBQAAAAAAAAAA",
+      "optical":"JgBYAAABJ5USExITERUROBEVERMSFBAVEjgQOhE5EhMRORI4ETkSORE4ETkSFBA5EhQRFBITERQRFBITETkSExI4EjgRORI5EgAFIwABKEsRAAxhAAEnSxIADQU=",
+      "coax":"JgBgAAABJ5YSExEUERQROREUERQSExEUEjgRORI5EhISORM3ETkRORITERQRORI5EhISExEVEhISORM3EBURFBE5ETkRORE5EQAFJQABJ0sSAAxhAAEmTBEADGEAASdLEgANBQAAAAAAAAAA"
+    }
+  }
+}

+ 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.10.0'
+VERSION = '1.11.0'
 MANIFEST_URL = (
     "https://raw.githubusercontent.com/"
     "smartHomeHub/SmartIR/{}/"

+ 15 - 10
custom_components/smartir/climate.py

@@ -320,18 +320,23 @@ class SmartIRClimate(ClimateEntity, RestoreEntity):
 
     async def send_command(self):
         async with self._temp_lock:
-            self._on_by_remote = False
-            operation_mode = self._hvac_mode
-            fan_mode = self._current_fan_mode
-            target_temperature = '{0:g}'.format(self._target_temperature)
+            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]
+                if operation_mode.lower() == HVAC_MODE_OFF:
+                    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 - 2
custom_components/smartir/manifest.json

@@ -7,8 +7,8 @@
   "requirements": ["aiofiles==0.5.0"],
   "homeassistant": "0.110.0b0",
   "updater": {
-    "version": "1.10.0",
-    "releaseNotes": "-- Fixes deprecation warnings",
+    "version": "1.11.0",
+    "releaseNotes": "-- Adds support to climate for independent ON command",
     "files": [
       "__init__.py",
       "climate.py",

+ 1 - 0
docs/MEDIA_PLAYER.md

@@ -140,6 +140,7 @@ Below are the code files created by the people in the community. Before you star
 | Code | Supported Models | Controller |
 | ------------- | -------------------------- | ------------- |
 [1160](../codes/media_player/1160.json)|Z906|Broadlink
+[1161](../codes/media_player/1161.json)|Z-5500|Broadlink
 
 #### TCL
 | Code | Supported Models | Controller |

+ 3 - 1
docs/README.md

@@ -1,4 +1,6 @@
-[![hacs_badge](https://img.shields.io/badge/HACS-Custom-orange.svg)](https://github.com/custom-components/hacs)
+[![](https://img.shields.io/github/v/release/smartHomeHub/SmartIR.svg?style=flat-square)](https://github.com/smartHomeHub/SmartIR/releases/latest) [![](https://img.shields.io/badge/HACS-Custom-orange.svg?style=flat-square)](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.