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

feature - Add Mode 0 to constants #2

Closed
oobayly opened this issue Jan 12, 2021 · 1 comment
Closed

feature - Add Mode 0 to constants #2

oobayly opened this issue Jan 12, 2021 · 1 comment

Comments

@oobayly
Copy link
Contributor

oobayly commented Jan 12, 2021

We have a Daikin Heat Reclaim Ventilation VAM unit, which is causing an error with the library. It has a mode of "0", which isn't in the constants /AirzoneCloudDaikin/contants.py

Error:

Traceback (most recent call last):
  File "./watch.py", line 14, in <module>
    api = AirzoneCloudDaikin(USER, PASS)
  File "/home/baylyj/.local/lib/python3.6/site-packages/AirzoneCloudDaikin/AirzoneCloudDaikin.py", line 45, in __init__
    self._load_installations()
  File "/home/baylyj/.local/lib/python3.6/site-packages/AirzoneCloudDaikin/AirzoneCloudDaikin.py", line 111, in _load_installations
    installation = Installation(self, installation_data)
  File "/home/baylyj/.local/lib/python3.6/site-packages/AirzoneCloudDaikin/Installation.py", line 24, in __init__
    self._load_devices()
  File "/home/baylyj/.local/lib/python3.6/site-packages/AirzoneCloudDaikin/Installation.py", line 115, in _load_devices
    device = Device(self._api, self, device_data)
  File "/home/baylyj/.local/lib/python3.6/site-packages/AirzoneCloudDaikin/Device.py", line 20, in __init__
    _LOGGER.info("Init {}".format(self.str_complete))
  File "/home/baylyj/.local/lib/python3.6/site-packages/AirzoneCloudDaikin/Device.py", line 37, in str_complete
    self.mode,
  File "/home/baylyj/.local/lib/python3.6/site-packages/AirzoneCloudDaikin/Device.py", line 80, in mode
    return MODES_CONVERTER[self.mode_raw]["name"]
KeyError: '0'

A simple solution would be to add a "None" mode:

 # 2020-05-23: extracted from website and saved copy in reverse/application.js
 
 MODES_CONVERTER = {
+    "0": {"name": "none", "type": "none", "description": "None"},
     "1": {"name": "cool", "type": "cold", "description": "Cooling mode"},
     "2": {"name": "heat", "type": "heat", "description": "Heating mode"},
     "3": {
oobayly added a commit to oobayly/AirzoneCloudDaikin that referenced this issue Jan 12, 2021
@max13fr
Copy link
Owner

max13fr commented Jan 16, 2021

Hi, thanks for your contribution, just merged & generate a new release.

Max

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants