Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing commands for Atomberg fan, making sure off #1305

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 24 additions & 15 deletions codes/fan/1170.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,30 @@
{
"manufacturer": "Atomberg",
"supportedModels": [
"manufacturer":"Atomberg",
"supportedModels":[
"Renesa"
],
"supportedController": "Broadlink",
"commandsEncoding": "Base64",
"speed": [
"1", "2", "3", "4", "5"
"supportedController":"Broadlink",
"commandsEncoding":"Base64",
"speed":[
"1",
"2",
"3",
"4",
"5",
"boost"
],
"commands": {
"off": "JgBQAAABJZITExMSExITEhMSExITExMSEzcTNhMTExITNxM2EzcTNxM3ExkMEhMSEzcTEhMTEjcTEhM3EzcTNxMSEzcTNxMSEwAFYQABJkkTAA0F",
"default": {
"1": "JgBQAAABJJMVEBQRFBEUEhQRFBEUERQRFDYUNhQRFRAUNhQ2FDYUNRQSFBEVEBQRFDYUERQRFDYUNhQ2FDYTNhQSEzYUNhQRFAAFYgABJUoVAA0F",
"2": "JgBQAAABJZMUERURFBEUERQRFBEUERURFDUUNhUQFREVNBQ2FDYUNhQRFTUUERU1FBEUERURFDUVNRUQFTUUERU1FTUUNhQRFQAFYAABJkkUAA0F",
"3": "JgBQAAABJZMTEhMTEhMTEhMSExITEhMTEzYTNxMSExMTNhM3EzcTNxM3EzcTEhMSEzcTEhMSEzcTEhMSEzcTNxMSEzcTNxMSEwAFYgABJkkTAA0F",
"4": "JgBQAAABJJMTEhMSExITExMSExITEhMSEzcTNxMWDxITNxM3EzcTNxITExITEhM3ExITEhMSEzcTNxM3EzcT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QRFBEUEhMSExIUERQRFDYUNRQSExITNhQ2FDUUNhQ2FDUUNhQ2FBEUERQRFDYUERQRFBEUEhM2FDUUNhQSEwAFbwABJ0oUAA0FAAAAAAAAAAA="
}
}
}
}
30 changes: 30 additions & 0 deletions codes/fan/7170.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"manufacturer": "Atomberg",
"supportedModels": [
"Effico"
],
"supportedController": "ESPHome",
"commandsEncoding": "Raw",
"speed": [
"1",
"2",
"3",
"4",
"5",
"boost"
],
"commands": {
"off": [
"[9025, -4448, 597, -541, 623, -514, 624, -514, 623, -517, 621, -513, 624, -513, 624, -516, 619, -513, 626, -1631, 627, -1633, 623, -515, 622, -516, 622, -1635, 599, -1659, 626, -1634, 623, -1636, 598, -542, 625, -512, 624, -512, 624, -514, 620, -1640, 594, -541, 624, -513, 626, -1631, 597, -1665, 596, -1660, 599, -1661, 570, -1691, 569, -569, 598, -1661, 569, -1692, 568, -570, 601 ]",
"[9011, -4477, 571, -569, 570, -609, 530, -568, 569, -569, 569, -570, 570, -568, 595, -544, 595, -543, 569, -1692, 595, -1664, 570, -570, 568, -570, 570, -1689, 569, -1691, 570, -1693, 567, -1691, 596, -1665, 569, -571, 567, -572, 567, -570, 569, -1691, 569, -570, 568, -571, 567, -1692, 595, -544, 570, -1689, 569, -1691, 569, -1691, 570, -569, 572, -1687, 595, -1665, 596, -544, 595 ]"
],
"default": {
"1": "[9004, -4475, 571, -569, 569, -568, 569, -569, 594, -543, 569, -570, 567, -569, 569, -569, 593, -546, 567, -1691, 596, -1666, 566, -570, 570, -568, 569, -1690, 596, -1663, 570, -1691, 595, -1663, 571, -1692, 594, -1665, 599, -540, 569, -1690, 598, -541, 568, -570, 569, -569, 569, -1690, 595, -544, 568, -573, 591, -1664, 571, -570, 568, -1690, 595, -1665, 570, -1691, 570, -570, 581 ]",
"2": "[9025, -4448, 597, -541, 623, -514, 624, -514, 623, -517, 621, -513, 624, -513, 624, -516, 619, -513, 626, -1631, 627, -1633, 623, -515, 622, -516, 622, -1635, 599, -1659, 626, -1634, 623, -1636, 598, -542, 625, -512, 624, -512, 624, -514, 620, -1640, 594, -541, 624, -513, 626, -1631, 597, -1665, 596, -1660, 599, -1661, 570, -1691, 569, -569, 598, -1661, 569, -1692, 568, -570, 601 ]",
"3": "[9017, -4444, 597, -543, 569, -570, 597, -540, 598, -540, 596, -538, 598, -538, 597, -539, 597, -539, 596, -1659, 597, -1662, 570, -570, 566, -574, 563, -1689, 595, -1663, 568, -1691, 596, -1662, 569, -573, 568, -1688, 594, -547, 566, -1689, 568, -571, 568, -570, 567, -571, 566, -1688, 567, -1691, 596, -543, 568, -1689, 570, -569, 567, -1693, 569, -1688, 570, -1690, 595, -544, 568 ]",
"4": "[9009, -4442, 571, -570, 566, -570, 591, -545, 568, -569, 564, -568, 568, -568, 566, -568, 592, -542, 592, -1658, 567, -1690, 567, -570, 595, -540, 596, -1657, 566, -1690, 568, -1688, 568, -1688, 567, -1691, 597, -1659, 599, -539, 599, -537, 620, -1634, 594, -541, 621, -514, 624, -1628, 596, -541, 622, -513, 621, -1630, 625, -1634, 594, -540, 624, -1630, 596, -1658, 598, -542, 619 ]",
"5": "[8980, -4470, 569, -572, 567, -569, 566, -571, 565, -569, 566, -568, 590, -545, 564, -569, 565, -568, 564, -168 7, 594, -1661, 594, -543, 565, -570, 567, -1686, 596, -1658, 593, -1664, 568, -1689, 568, -570, 567, -570, 565, -569, 565, -1688, 593, -543, 595, -540, 564, -570, 566, -1686, 566, -1690, 567, -1689, 566, -1691, 566, -571, 566, -1687, 567, -1689, 567, -1691, 566, -572, 566 ]",
"boost": "[9027, -4445, 599, -542, 597, -540, 623, -515, 622, -515, 622, -516, 624, -512, 624, -514, 622, -513, 624, -1636, 622, -1636, 625, -513, 626, -511, 626, -1633, 625, -1635, 598, -1661, 624, -1636, 623, -1637, 624, -1635, 626, -1634, 623, -1636, 626, -512, 626, -512, 624, -514, 624, -1633, 625, -515, 624, -513, 597, -541, 624, -513, 622, -1635, 624, -1661, 572, -1662, 625, -515, 623 ]"
}
}
}
17 changes: 13 additions & 4 deletions custom_components/smartir/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,17 @@ def check_encoding(self, encoding):
"by the ESPHome controller.")

async def send(self, command):
"""Send a command."""
service_data = {'command': json.loads(command)}
"""Send commands."""
commands = []

await self.hass.services.async_call(
'esphome', self._controller_data, service_data)
if not isinstance(command, list):
command = [command]

for _command in command:
commands.append(_command)

for _command in commands:
service_data = {'command': json.loads(_command)}

await self.hass.services.async_call(
'esphome', self._controller_data, service_data)
4 changes: 3 additions & 1 deletion docs/FAN.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@ Contributing to your own code files is welcome. However, we do not accept incomp
| Code | Supported Models | Notes |Controller |
| ------------- | ----- | ----- | ------------- |
[1160](../codes/fan/1160.json)|Efficio||Broadlink
[1170](../codes/fan/1170.json)|Renesa|Speeds `1,2,3,4,5` is mapped to `2,3,4,5,Boost` on the remote|Broadlink
[1170](../codes/fan/1170.json)|Renesa|Speeds `1,2,3,4,5,boost` on the remote|Broadlink. Off will deteminstically switch off the fan always
[7170](../codes/fan/7170.json)|Renesa|Speeds `1,2,3,4,5,boost` on the remote|ESPHome. Off will deteminstically switch off the fan always


#### Lucci Air

Expand Down