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

has_emergency_heat returning incorrect status in v2.0b #7

Closed
ryannazaretian opened this issue Mar 12, 2020 · 11 comments
Closed

has_emergency_heat returning incorrect status in v2.0b #7

ryannazaretian opened this issue Mar 12, 2020 · 11 comments
Assignees
Labels
bug Something isn't working

Comments

@ryannazaretian
Copy link
Owner

Haven't looked into this yet, but the has_emergency_heat() function seems to be returning False on my system now.

@ryannazaretian ryannazaretian added the bug Something isn't working label Mar 12, 2020
@bdraco
Copy link
Collaborator

bdraco commented Mar 12, 2020

I don’t have emergency heat on mine so I couldn’t validate this one. If you send a json dump I’ll create test fixtures and some tests to fix this

@ryannazaretian
Copy link
Owner Author

xxl_thermostats.json.txt

@bdraco
Copy link
Collaborator

bdraco commented Mar 12, 2020

xxl_thermostats.json.txt

Sorry, I should been more specific. I need the one from the mobile endpoint that _get_thermostat_json is now hitting:

https://www.mynexia.com/mobile/houses/{house_id}

@bdraco bdraco self-assigned this Mar 12, 2020
@bdraco bdraco pinned this issue Mar 12, 2020
@ryannazaretian
Copy link
Owner Author

ryannazaretian commented Mar 12, 2020 via email

@bdraco
Copy link
Collaborator

bdraco commented Mar 12, 2020

@ryannazaretian I added a tests/fixtures directory in this PR #8

@bdraco
Copy link
Collaborator

bdraco commented Mar 27, 2020

I might have fixed this in nexia 0.7.3 however I guessed at the key name since mine doesn't have the emergency heat option.

@ryannazaretian
Copy link
Owner Author

ryannazaretian commented Apr 11, 2020

Doesn't seem like it. Sorry I've been AWOL... still working crazy hours w/ work.

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 104, in _handle_refresh_interval
    await self.async_refresh()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 169, in async_refresh
    update_callback()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 297, in async_write_ha_state
    self._async_write_ha_state()  # type: ignore
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 327, in _async_write_ha_state
    attr.update(self.state_attributes or {})
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 260, in state_attributes
    data[ATTR_AUX_HEAT] = STATE_ON if self.is_aux_heat else STATE_OFF
  File "/usr/src/homeassistant/homeassistant/components/nexia/climate.py", line 359, in is_aux_heat
    return self._thermostat.is_emergency_heat_active()
  File "/usr/local/lib/python3.7/site-packages/nexia/thermostat.py", line 232, in is_emergency_heat_active
    return self.get_thermostat_settings_key("emergency_heat_active")
  File "/usr/local/lib/python3.7/site-packages/nexia/thermostat.py", line 602, in get_thermostat_settings_key
    return self._get_thermostat_deep_key("settings", "type", key)
  File "/usr/local/lib/python3.7/site-packages/nexia/thermostat.py", line 531, in _get_thermostat_deep_key
    self._thermostat_json[area], area_primary_key, key
  File "/usr/local/lib/python3.7/site-packages/nexia/util.py", line 29, in find_dict_with_keyvalue_in_json
    raise KeyError
KeyError

@bdraco
Copy link
Collaborator

bdraco commented Apr 11, 2020

No worries. Looks like I did fix has_emergency_heat but not is_emergency_heat_active .. so closer :)

@ryannazaretian
Copy link
Owner Author

Did I ever send you the mobile JSON? I don't think I did.

@bdraco
Copy link
Collaborator

bdraco commented Apr 11, 2020

Did I ever send you the mobile JSON? I don't think I did.

Nope, but I don't think I need it since I've got a few of them that have it now

@bdraco
Copy link
Collaborator

bdraco commented Apr 11, 2020

Fixed is_emergency_heat_active in 0.9.1 #12

@bdraco bdraco closed this as completed Mar 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants