core/homeassistant/components/evohome/__init__.py

164 lines
5.6 KiB
Python
Raw Normal View History

Add zones to evohome component (#18428) * Added Zones, and removed available() logic flesh out Zones tidy up init some more tidying up Nearly there - full functionality passed txo - ready to send PR Ready to PR, except to remove logging Add Zones and associated functionality to evohome component Add Zones to evohome (some more tidying up) Add Zones to evohome (Nearly there - full functionality) Add Zones to evohome (passed tox) Add Zones to evohome (except to remove logging) Add Zones and associated functionality to evohome component Revert _LOGGER.warn to .debug, as it should be Cleanup stupid REBASE * removed a duplicate/unwanted code block * tidy up comment * use async_added_to_hass instead of bus.listen * Pass evo_data instead of hass when instntiating * switch to async version of setup_platform/add_entities * Remove workaround for bug in client library - using github version for now, as awaiting new PyPi package * Avoid invalid-name lint - use 'zone_idx' instead of 'z' * Fix line too long error * remove commented-out line of code * fix a logic error, improve REDACTION of potentially-sensitive infomation * restore use of EVENT_HOMEASSISTANT_START to improve HA startup time * added a docstring to _flatten_json * Switch instantiation from component to platform * Use v0.2.8 of client api (resolves logging bug) * import rather than duplicate, and de-lint * We use evohomeclient v0.2.8 now * remove all the api logging * Changed scan_interal to Throttle * added a configurable scan_interval * small code tidy-up, removed sub-function * tidy up update() code * minimize use of self.hass.data[] * remove lint * remove unwanted logging * remove debug code * correct a small coding error * small tidyup of code * remove flatten_json * add @callback to _first_update() * switch back to load_platform * adhere to standards fro logging * use new format string formatting * minor change to comments * convert scan_interval to timedelta from int * restore rounding up of scan_interval * code tidy up * sync when in sync context * fix typo * remove raises not needed * tidy up typos, etc. * remove invalid-name lint * tidy up exception handling * de-lint/pretty-fy * move 'status' to a JSON node, so theirs room for 'config', 'schedule' in the future
2018-11-27 11:17:22 +00:00
"""Support for (EMEA/EU-based) Honeywell evohome systems.
Add (EU-based) Honeywell evohome CH/DHW controller (#16427) * Add support for Honeywell evohome CH/DHW systems More flake8 corrections Passes Flake8 tests Almost passed flake8.pylint! Passed all tox tests Now it needs serious testing! Almost ready to submit BUGFIX: DHW state now functional More improvements to available() Solved the DHW temp units problem! Last minute bug squash to improve dicts merge Trying to rebase fixing more rbase errors revert to creating HTTP_error_code internally for now ready to submit PR Added support for Honeywell evohome CH/DHW systems * Updated requirements_test_all.txt * Fix: D401 First line should be in imperative mood * Remove _LOGGER.info (replace with _LOGGER.debug) * raise PlatformNotReady when RequestException during setup() * Revert some LOGGER.debug to LOGGER.warning * Improved logging levels, and removed some unwanted comments * Improvments to logging - additional self._status info * BUGFIX: DHW wrongly showing available = False (and some other tweaks) * Fix trailing whitespace * Remove state_attributes override and API_VER code * Removed heating zones, DHW and heuristics to reduce # lines of code * Removed some more lines of code * Removed unused configuration parameters * Remove some more un-needed lines * Removed more (uneeded) lines of code & fixed two minor typos * Improvements to debug logging of available() = False * Improvements to code, and code clean-up * Corrected a minor typo * A small tidy up * reduces precision of emulated temps floats to 0.1 * Some code improvements as suggested by JeardM * Rewrite of exception handler * Removed another unwanted logging in properties * Remove async_ version of various methods * moved available heuristics to update() * Cleanup of code, and re-work linter hints * fixed a minor documentation typo * scan_interval is now no longer a configurable option * Change from Master/Slave to Parent/Child * Removed the last of the slaves * Removed the last of the masters * Move -PARALLEL_UPDATES to .\climate\evohome.py' * main code moved to climate/evohome.py * merge EvoEntity into EvoController class * remove should_poll (for now) * woops! left a hint in * removed icon * only log a WARNING the first time available = False * cleanup dodgy exception handling * Tidy up exception handling * Many changes as suggested by @MartinHjelmare, thanks * remove hass from init, part 1 * use async_added_to_hass instead of dispatcher_connect * remove hass from init, part 2 (done) * add 1-2 arrays, and tidied up some comments * from dispatcher to async_added_to_hass * cleaned up some logging, and removed others * Many changes as request by @MartinHjelmare * Homage to the lint * Changed to the HA of doing operating_mode * Now using update_before_add=True * reduced logging further still... * fixed minor lint * fix a small logic error * Add device_state_attributes to track actual operating mode * Clean up doc quotes caused by previous changes * Woops! removed some debug lines that shoudln't have stayed in * Add a complete set of device_state_attributes * Cleanup some constants * Remove more legacy code * domain_data to evo_data & this else should be a finally * minor change for readability * Minor change for readability #2 * removed unused code * small tidy up - no code changes * fix minor lint * Correct URLs & descriptions in docstring * whoops - fixed a typo in docstrings * remove an unused line of cide & a small tidy-up
2018-09-27 11:29:44 +00:00
Support for a temperature control system (TCS, controller) with 0+ heating
zones (e.g. TRVs, relays) and, optionally, a DHW controller.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/evohome/
"""
# Glossary:
Add zones to evohome component (#18428) * Added Zones, and removed available() logic flesh out Zones tidy up init some more tidying up Nearly there - full functionality passed txo - ready to send PR Ready to PR, except to remove logging Add Zones and associated functionality to evohome component Add Zones to evohome (some more tidying up) Add Zones to evohome (Nearly there - full functionality) Add Zones to evohome (passed tox) Add Zones to evohome (except to remove logging) Add Zones and associated functionality to evohome component Revert _LOGGER.warn to .debug, as it should be Cleanup stupid REBASE * removed a duplicate/unwanted code block * tidy up comment * use async_added_to_hass instead of bus.listen * Pass evo_data instead of hass when instntiating * switch to async version of setup_platform/add_entities * Remove workaround for bug in client library - using github version for now, as awaiting new PyPi package * Avoid invalid-name lint - use 'zone_idx' instead of 'z' * Fix line too long error * remove commented-out line of code * fix a logic error, improve REDACTION of potentially-sensitive infomation * restore use of EVENT_HOMEASSISTANT_START to improve HA startup time * added a docstring to _flatten_json * Switch instantiation from component to platform * Use v0.2.8 of client api (resolves logging bug) * import rather than duplicate, and de-lint * We use evohomeclient v0.2.8 now * remove all the api logging * Changed scan_interal to Throttle * added a configurable scan_interval * small code tidy-up, removed sub-function * tidy up update() code * minimize use of self.hass.data[] * remove lint * remove unwanted logging * remove debug code * correct a small coding error * small tidyup of code * remove flatten_json * add @callback to _first_update() * switch back to load_platform * adhere to standards fro logging * use new format string formatting * minor change to comments * convert scan_interval to timedelta from int * restore rounding up of scan_interval * code tidy up * sync when in sync context * fix typo * remove raises not needed * tidy up typos, etc. * remove invalid-name lint * tidy up exception handling * de-lint/pretty-fy * move 'status' to a JSON node, so theirs room for 'config', 'schedule' in the future
2018-11-27 11:17:22 +00:00
# TCS - temperature control system (a.k.a. Controller, Parent), which can
# have up to 13 Children:
# 0-12 Heating zones (a.k.a. Zone), and
# 0-1 DHW controller, (a.k.a. Boiler)
# The TCS & Zones are implemented as Climate devices, Boiler as a WaterHeater
Add (EU-based) Honeywell evohome CH/DHW controller (#16427) * Add support for Honeywell evohome CH/DHW systems More flake8 corrections Passes Flake8 tests Almost passed flake8.pylint! Passed all tox tests Now it needs serious testing! Almost ready to submit BUGFIX: DHW state now functional More improvements to available() Solved the DHW temp units problem! Last minute bug squash to improve dicts merge Trying to rebase fixing more rbase errors revert to creating HTTP_error_code internally for now ready to submit PR Added support for Honeywell evohome CH/DHW systems * Updated requirements_test_all.txt * Fix: D401 First line should be in imperative mood * Remove _LOGGER.info (replace with _LOGGER.debug) * raise PlatformNotReady when RequestException during setup() * Revert some LOGGER.debug to LOGGER.warning * Improved logging levels, and removed some unwanted comments * Improvments to logging - additional self._status info * BUGFIX: DHW wrongly showing available = False (and some other tweaks) * Fix trailing whitespace * Remove state_attributes override and API_VER code * Removed heating zones, DHW and heuristics to reduce # lines of code * Removed some more lines of code * Removed unused configuration parameters * Remove some more un-needed lines * Removed more (uneeded) lines of code & fixed two minor typos * Improvements to debug logging of available() = False * Improvements to code, and code clean-up * Corrected a minor typo * A small tidy up * reduces precision of emulated temps floats to 0.1 * Some code improvements as suggested by JeardM * Rewrite of exception handler * Removed another unwanted logging in properties * Remove async_ version of various methods * moved available heuristics to update() * Cleanup of code, and re-work linter hints * fixed a minor documentation typo * scan_interval is now no longer a configurable option * Change from Master/Slave to Parent/Child * Removed the last of the slaves * Removed the last of the masters * Move -PARALLEL_UPDATES to .\climate\evohome.py' * main code moved to climate/evohome.py * merge EvoEntity into EvoController class * remove should_poll (for now) * woops! left a hint in * removed icon * only log a WARNING the first time available = False * cleanup dodgy exception handling * Tidy up exception handling * Many changes as suggested by @MartinHjelmare, thanks * remove hass from init, part 1 * use async_added_to_hass instead of dispatcher_connect * remove hass from init, part 2 (done) * add 1-2 arrays, and tidied up some comments * from dispatcher to async_added_to_hass * cleaned up some logging, and removed others * Many changes as request by @MartinHjelmare * Homage to the lint * Changed to the HA of doing operating_mode * Now using update_before_add=True * reduced logging further still... * fixed minor lint * fix a small logic error * Add device_state_attributes to track actual operating mode * Clean up doc quotes caused by previous changes * Woops! removed some debug lines that shoudln't have stayed in * Add a complete set of device_state_attributes * Cleanup some constants * Remove more legacy code * domain_data to evo_data & this else should be a finally * minor change for readability * Minor change for readability #2 * removed unused code * small tidy up - no code changes * fix minor lint * Correct URLs & descriptions in docstring * whoops - fixed a typo in docstrings * remove an unused line of cide & a small tidy-up
2018-09-27 11:29:44 +00:00
Add zones to evohome component (#18428) * Added Zones, and removed available() logic flesh out Zones tidy up init some more tidying up Nearly there - full functionality passed txo - ready to send PR Ready to PR, except to remove logging Add Zones and associated functionality to evohome component Add Zones to evohome (some more tidying up) Add Zones to evohome (Nearly there - full functionality) Add Zones to evohome (passed tox) Add Zones to evohome (except to remove logging) Add Zones and associated functionality to evohome component Revert _LOGGER.warn to .debug, as it should be Cleanup stupid REBASE * removed a duplicate/unwanted code block * tidy up comment * use async_added_to_hass instead of bus.listen * Pass evo_data instead of hass when instntiating * switch to async version of setup_platform/add_entities * Remove workaround for bug in client library - using github version for now, as awaiting new PyPi package * Avoid invalid-name lint - use 'zone_idx' instead of 'z' * Fix line too long error * remove commented-out line of code * fix a logic error, improve REDACTION of potentially-sensitive infomation * restore use of EVENT_HOMEASSISTANT_START to improve HA startup time * added a docstring to _flatten_json * Switch instantiation from component to platform * Use v0.2.8 of client api (resolves logging bug) * import rather than duplicate, and de-lint * We use evohomeclient v0.2.8 now * remove all the api logging * Changed scan_interal to Throttle * added a configurable scan_interval * small code tidy-up, removed sub-function * tidy up update() code * minimize use of self.hass.data[] * remove lint * remove unwanted logging * remove debug code * correct a small coding error * small tidyup of code * remove flatten_json * add @callback to _first_update() * switch back to load_platform * adhere to standards fro logging * use new format string formatting * minor change to comments * convert scan_interval to timedelta from int * restore rounding up of scan_interval * code tidy up * sync when in sync context * fix typo * remove raises not needed * tidy up typos, etc. * remove invalid-name lint * tidy up exception handling * de-lint/pretty-fy * move 'status' to a JSON node, so theirs room for 'config', 'schedule' in the future
2018-11-27 11:17:22 +00:00
from datetime import timedelta
Add (EU-based) Honeywell evohome CH/DHW controller (#16427) * Add support for Honeywell evohome CH/DHW systems More flake8 corrections Passes Flake8 tests Almost passed flake8.pylint! Passed all tox tests Now it needs serious testing! Almost ready to submit BUGFIX: DHW state now functional More improvements to available() Solved the DHW temp units problem! Last minute bug squash to improve dicts merge Trying to rebase fixing more rbase errors revert to creating HTTP_error_code internally for now ready to submit PR Added support for Honeywell evohome CH/DHW systems * Updated requirements_test_all.txt * Fix: D401 First line should be in imperative mood * Remove _LOGGER.info (replace with _LOGGER.debug) * raise PlatformNotReady when RequestException during setup() * Revert some LOGGER.debug to LOGGER.warning * Improved logging levels, and removed some unwanted comments * Improvments to logging - additional self._status info * BUGFIX: DHW wrongly showing available = False (and some other tweaks) * Fix trailing whitespace * Remove state_attributes override and API_VER code * Removed heating zones, DHW and heuristics to reduce # lines of code * Removed some more lines of code * Removed unused configuration parameters * Remove some more un-needed lines * Removed more (uneeded) lines of code & fixed two minor typos * Improvements to debug logging of available() = False * Improvements to code, and code clean-up * Corrected a minor typo * A small tidy up * reduces precision of emulated temps floats to 0.1 * Some code improvements as suggested by JeardM * Rewrite of exception handler * Removed another unwanted logging in properties * Remove async_ version of various methods * moved available heuristics to update() * Cleanup of code, and re-work linter hints * fixed a minor documentation typo * scan_interval is now no longer a configurable option * Change from Master/Slave to Parent/Child * Removed the last of the slaves * Removed the last of the masters * Move -PARALLEL_UPDATES to .\climate\evohome.py' * main code moved to climate/evohome.py * merge EvoEntity into EvoController class * remove should_poll (for now) * woops! left a hint in * removed icon * only log a WARNING the first time available = False * cleanup dodgy exception handling * Tidy up exception handling * Many changes as suggested by @MartinHjelmare, thanks * remove hass from init, part 1 * use async_added_to_hass instead of dispatcher_connect * remove hass from init, part 2 (done) * add 1-2 arrays, and tidied up some comments * from dispatcher to async_added_to_hass * cleaned up some logging, and removed others * Many changes as request by @MartinHjelmare * Homage to the lint * Changed to the HA of doing operating_mode * Now using update_before_add=True * reduced logging further still... * fixed minor lint * fix a small logic error * Add device_state_attributes to track actual operating mode * Clean up doc quotes caused by previous changes * Woops! removed some debug lines that shoudln't have stayed in * Add a complete set of device_state_attributes * Cleanup some constants * Remove more legacy code * domain_data to evo_data & this else should be a finally * minor change for readability * Minor change for readability #2 * removed unused code * small tidy up - no code changes * fix minor lint * Correct URLs & descriptions in docstring * whoops - fixed a typo in docstrings * remove an unused line of cide & a small tidy-up
2018-09-27 11:29:44 +00:00
import logging
from requests.exceptions import HTTPError
import voluptuous as vol
from homeassistant.const import (
Add zones to evohome component (#18428) * Added Zones, and removed available() logic flesh out Zones tidy up init some more tidying up Nearly there - full functionality passed txo - ready to send PR Ready to PR, except to remove logging Add Zones and associated functionality to evohome component Add Zones to evohome (some more tidying up) Add Zones to evohome (Nearly there - full functionality) Add Zones to evohome (passed tox) Add Zones to evohome (except to remove logging) Add Zones and associated functionality to evohome component Revert _LOGGER.warn to .debug, as it should be Cleanup stupid REBASE * removed a duplicate/unwanted code block * tidy up comment * use async_added_to_hass instead of bus.listen * Pass evo_data instead of hass when instntiating * switch to async version of setup_platform/add_entities * Remove workaround for bug in client library - using github version for now, as awaiting new PyPi package * Avoid invalid-name lint - use 'zone_idx' instead of 'z' * Fix line too long error * remove commented-out line of code * fix a logic error, improve REDACTION of potentially-sensitive infomation * restore use of EVENT_HOMEASSISTANT_START to improve HA startup time * added a docstring to _flatten_json * Switch instantiation from component to platform * Use v0.2.8 of client api (resolves logging bug) * import rather than duplicate, and de-lint * We use evohomeclient v0.2.8 now * remove all the api logging * Changed scan_interal to Throttle * added a configurable scan_interval * small code tidy-up, removed sub-function * tidy up update() code * minimize use of self.hass.data[] * remove lint * remove unwanted logging * remove debug code * correct a small coding error * small tidyup of code * remove flatten_json * add @callback to _first_update() * switch back to load_platform * adhere to standards fro logging * use new format string formatting * minor change to comments * convert scan_interval to timedelta from int * restore rounding up of scan_interval * code tidy up * sync when in sync context * fix typo * remove raises not needed * tidy up typos, etc. * remove invalid-name lint * tidy up exception handling * de-lint/pretty-fy * move 'status' to a JSON node, so theirs room for 'config', 'schedule' in the future
2018-11-27 11:17:22 +00:00
CONF_SCAN_INTERVAL, CONF_USERNAME, CONF_PASSWORD,
EVENT_HOMEASSISTANT_START,
HTTP_BAD_REQUEST, HTTP_SERVICE_UNAVAILABLE, HTTP_TOO_MANY_REQUESTS
Add (EU-based) Honeywell evohome CH/DHW controller (#16427) * Add support for Honeywell evohome CH/DHW systems More flake8 corrections Passes Flake8 tests Almost passed flake8.pylint! Passed all tox tests Now it needs serious testing! Almost ready to submit BUGFIX: DHW state now functional More improvements to available() Solved the DHW temp units problem! Last minute bug squash to improve dicts merge Trying to rebase fixing more rbase errors revert to creating HTTP_error_code internally for now ready to submit PR Added support for Honeywell evohome CH/DHW systems * Updated requirements_test_all.txt * Fix: D401 First line should be in imperative mood * Remove _LOGGER.info (replace with _LOGGER.debug) * raise PlatformNotReady when RequestException during setup() * Revert some LOGGER.debug to LOGGER.warning * Improved logging levels, and removed some unwanted comments * Improvments to logging - additional self._status info * BUGFIX: DHW wrongly showing available = False (and some other tweaks) * Fix trailing whitespace * Remove state_attributes override and API_VER code * Removed heating zones, DHW and heuristics to reduce # lines of code * Removed some more lines of code * Removed unused configuration parameters * Remove some more un-needed lines * Removed more (uneeded) lines of code & fixed two minor typos * Improvements to debug logging of available() = False * Improvements to code, and code clean-up * Corrected a minor typo * A small tidy up * reduces precision of emulated temps floats to 0.1 * Some code improvements as suggested by JeardM * Rewrite of exception handler * Removed another unwanted logging in properties * Remove async_ version of various methods * moved available heuristics to update() * Cleanup of code, and re-work linter hints * fixed a minor documentation typo * scan_interval is now no longer a configurable option * Change from Master/Slave to Parent/Child * Removed the last of the slaves * Removed the last of the masters * Move -PARALLEL_UPDATES to .\climate\evohome.py' * main code moved to climate/evohome.py * merge EvoEntity into EvoController class * remove should_poll (for now) * woops! left a hint in * removed icon * only log a WARNING the first time available = False * cleanup dodgy exception handling * Tidy up exception handling * Many changes as suggested by @MartinHjelmare, thanks * remove hass from init, part 1 * use async_added_to_hass instead of dispatcher_connect * remove hass from init, part 2 (done) * add 1-2 arrays, and tidied up some comments * from dispatcher to async_added_to_hass * cleaned up some logging, and removed others * Many changes as request by @MartinHjelmare * Homage to the lint * Changed to the HA of doing operating_mode * Now using update_before_add=True * reduced logging further still... * fixed minor lint * fix a small logic error * Add device_state_attributes to track actual operating mode * Clean up doc quotes caused by previous changes * Woops! removed some debug lines that shoudln't have stayed in * Add a complete set of device_state_attributes * Cleanup some constants * Remove more legacy code * domain_data to evo_data & this else should be a finally * minor change for readability * Minor change for readability #2 * removed unused code * small tidy up - no code changes * fix minor lint * Correct URLs & descriptions in docstring * whoops - fixed a typo in docstrings * remove an unused line of cide & a small tidy-up
2018-09-27 11:29:44 +00:00
)
Add zones to evohome component (#18428) * Added Zones, and removed available() logic flesh out Zones tidy up init some more tidying up Nearly there - full functionality passed txo - ready to send PR Ready to PR, except to remove logging Add Zones and associated functionality to evohome component Add Zones to evohome (some more tidying up) Add Zones to evohome (Nearly there - full functionality) Add Zones to evohome (passed tox) Add Zones to evohome (except to remove logging) Add Zones and associated functionality to evohome component Revert _LOGGER.warn to .debug, as it should be Cleanup stupid REBASE * removed a duplicate/unwanted code block * tidy up comment * use async_added_to_hass instead of bus.listen * Pass evo_data instead of hass when instntiating * switch to async version of setup_platform/add_entities * Remove workaround for bug in client library - using github version for now, as awaiting new PyPi package * Avoid invalid-name lint - use 'zone_idx' instead of 'z' * Fix line too long error * remove commented-out line of code * fix a logic error, improve REDACTION of potentially-sensitive infomation * restore use of EVENT_HOMEASSISTANT_START to improve HA startup time * added a docstring to _flatten_json * Switch instantiation from component to platform * Use v0.2.8 of client api (resolves logging bug) * import rather than duplicate, and de-lint * We use evohomeclient v0.2.8 now * remove all the api logging * Changed scan_interal to Throttle * added a configurable scan_interval * small code tidy-up, removed sub-function * tidy up update() code * minimize use of self.hass.data[] * remove lint * remove unwanted logging * remove debug code * correct a small coding error * small tidyup of code * remove flatten_json * add @callback to _first_update() * switch back to load_platform * adhere to standards fro logging * use new format string formatting * minor change to comments * convert scan_interval to timedelta from int * restore rounding up of scan_interval * code tidy up * sync when in sync context * fix typo * remove raises not needed * tidy up typos, etc. * remove invalid-name lint * tidy up exception handling * de-lint/pretty-fy * move 'status' to a JSON node, so theirs room for 'config', 'schedule' in the future
2018-11-27 11:17:22 +00:00
from homeassistant.core import callback
Add (EU-based) Honeywell evohome CH/DHW controller (#16427) * Add support for Honeywell evohome CH/DHW systems More flake8 corrections Passes Flake8 tests Almost passed flake8.pylint! Passed all tox tests Now it needs serious testing! Almost ready to submit BUGFIX: DHW state now functional More improvements to available() Solved the DHW temp units problem! Last minute bug squash to improve dicts merge Trying to rebase fixing more rbase errors revert to creating HTTP_error_code internally for now ready to submit PR Added support for Honeywell evohome CH/DHW systems * Updated requirements_test_all.txt * Fix: D401 First line should be in imperative mood * Remove _LOGGER.info (replace with _LOGGER.debug) * raise PlatformNotReady when RequestException during setup() * Revert some LOGGER.debug to LOGGER.warning * Improved logging levels, and removed some unwanted comments * Improvments to logging - additional self._status info * BUGFIX: DHW wrongly showing available = False (and some other tweaks) * Fix trailing whitespace * Remove state_attributes override and API_VER code * Removed heating zones, DHW and heuristics to reduce # lines of code * Removed some more lines of code * Removed unused configuration parameters * Remove some more un-needed lines * Removed more (uneeded) lines of code & fixed two minor typos * Improvements to debug logging of available() = False * Improvements to code, and code clean-up * Corrected a minor typo * A small tidy up * reduces precision of emulated temps floats to 0.1 * Some code improvements as suggested by JeardM * Rewrite of exception handler * Removed another unwanted logging in properties * Remove async_ version of various methods * moved available heuristics to update() * Cleanup of code, and re-work linter hints * fixed a minor documentation typo * scan_interval is now no longer a configurable option * Change from Master/Slave to Parent/Child * Removed the last of the slaves * Removed the last of the masters * Move -PARALLEL_UPDATES to .\climate\evohome.py' * main code moved to climate/evohome.py * merge EvoEntity into EvoController class * remove should_poll (for now) * woops! left a hint in * removed icon * only log a WARNING the first time available = False * cleanup dodgy exception handling * Tidy up exception handling * Many changes as suggested by @MartinHjelmare, thanks * remove hass from init, part 1 * use async_added_to_hass instead of dispatcher_connect * remove hass from init, part 2 (done) * add 1-2 arrays, and tidied up some comments * from dispatcher to async_added_to_hass * cleaned up some logging, and removed others * Many changes as request by @MartinHjelmare * Homage to the lint * Changed to the HA of doing operating_mode * Now using update_before_add=True * reduced logging further still... * fixed minor lint * fix a small logic error * Add device_state_attributes to track actual operating mode * Clean up doc quotes caused by previous changes * Woops! removed some debug lines that shoudln't have stayed in * Add a complete set of device_state_attributes * Cleanup some constants * Remove more legacy code * domain_data to evo_data & this else should be a finally * minor change for readability * Minor change for readability #2 * removed unused code * small tidy up - no code changes * fix minor lint * Correct URLs & descriptions in docstring * whoops - fixed a typo in docstrings * remove an unused line of cide & a small tidy-up
2018-09-27 11:29:44 +00:00
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.discovery import load_platform
Add zones to evohome component (#18428) * Added Zones, and removed available() logic flesh out Zones tidy up init some more tidying up Nearly there - full functionality passed txo - ready to send PR Ready to PR, except to remove logging Add Zones and associated functionality to evohome component Add Zones to evohome (some more tidying up) Add Zones to evohome (Nearly there - full functionality) Add Zones to evohome (passed tox) Add Zones to evohome (except to remove logging) Add Zones and associated functionality to evohome component Revert _LOGGER.warn to .debug, as it should be Cleanup stupid REBASE * removed a duplicate/unwanted code block * tidy up comment * use async_added_to_hass instead of bus.listen * Pass evo_data instead of hass when instntiating * switch to async version of setup_platform/add_entities * Remove workaround for bug in client library - using github version for now, as awaiting new PyPi package * Avoid invalid-name lint - use 'zone_idx' instead of 'z' * Fix line too long error * remove commented-out line of code * fix a logic error, improve REDACTION of potentially-sensitive infomation * restore use of EVENT_HOMEASSISTANT_START to improve HA startup time * added a docstring to _flatten_json * Switch instantiation from component to platform * Use v0.2.8 of client api (resolves logging bug) * import rather than duplicate, and de-lint * We use evohomeclient v0.2.8 now * remove all the api logging * Changed scan_interal to Throttle * added a configurable scan_interval * small code tidy-up, removed sub-function * tidy up update() code * minimize use of self.hass.data[] * remove lint * remove unwanted logging * remove debug code * correct a small coding error * small tidyup of code * remove flatten_json * add @callback to _first_update() * switch back to load_platform * adhere to standards fro logging * use new format string formatting * minor change to comments * convert scan_interval to timedelta from int * restore rounding up of scan_interval * code tidy up * sync when in sync context * fix typo * remove raises not needed * tidy up typos, etc. * remove invalid-name lint * tidy up exception handling * de-lint/pretty-fy * move 'status' to a JSON node, so theirs room for 'config', 'schedule' in the future
2018-11-27 11:17:22 +00:00
from homeassistant.helpers.dispatcher import async_dispatcher_send
Add (EU-based) Honeywell evohome CH/DHW controller (#16427) * Add support for Honeywell evohome CH/DHW systems More flake8 corrections Passes Flake8 tests Almost passed flake8.pylint! Passed all tox tests Now it needs serious testing! Almost ready to submit BUGFIX: DHW state now functional More improvements to available() Solved the DHW temp units problem! Last minute bug squash to improve dicts merge Trying to rebase fixing more rbase errors revert to creating HTTP_error_code internally for now ready to submit PR Added support for Honeywell evohome CH/DHW systems * Updated requirements_test_all.txt * Fix: D401 First line should be in imperative mood * Remove _LOGGER.info (replace with _LOGGER.debug) * raise PlatformNotReady when RequestException during setup() * Revert some LOGGER.debug to LOGGER.warning * Improved logging levels, and removed some unwanted comments * Improvments to logging - additional self._status info * BUGFIX: DHW wrongly showing available = False (and some other tweaks) * Fix trailing whitespace * Remove state_attributes override and API_VER code * Removed heating zones, DHW and heuristics to reduce # lines of code * Removed some more lines of code * Removed unused configuration parameters * Remove some more un-needed lines * Removed more (uneeded) lines of code & fixed two minor typos * Improvements to debug logging of available() = False * Improvements to code, and code clean-up * Corrected a minor typo * A small tidy up * reduces precision of emulated temps floats to 0.1 * Some code improvements as suggested by JeardM * Rewrite of exception handler * Removed another unwanted logging in properties * Remove async_ version of various methods * moved available heuristics to update() * Cleanup of code, and re-work linter hints * fixed a minor documentation typo * scan_interval is now no longer a configurable option * Change from Master/Slave to Parent/Child * Removed the last of the slaves * Removed the last of the masters * Move -PARALLEL_UPDATES to .\climate\evohome.py' * main code moved to climate/evohome.py * merge EvoEntity into EvoController class * remove should_poll (for now) * woops! left a hint in * removed icon * only log a WARNING the first time available = False * cleanup dodgy exception handling * Tidy up exception handling * Many changes as suggested by @MartinHjelmare, thanks * remove hass from init, part 1 * use async_added_to_hass instead of dispatcher_connect * remove hass from init, part 2 (done) * add 1-2 arrays, and tidied up some comments * from dispatcher to async_added_to_hass * cleaned up some logging, and removed others * Many changes as request by @MartinHjelmare * Homage to the lint * Changed to the HA of doing operating_mode * Now using update_before_add=True * reduced logging further still... * fixed minor lint * fix a small logic error * Add device_state_attributes to track actual operating mode * Clean up doc quotes caused by previous changes * Woops! removed some debug lines that shoudln't have stayed in * Add a complete set of device_state_attributes * Cleanup some constants * Remove more legacy code * domain_data to evo_data & this else should be a finally * minor change for readability * Minor change for readability #2 * removed unused code * small tidy up - no code changes * fix minor lint * Correct URLs & descriptions in docstring * whoops - fixed a typo in docstrings * remove an unused line of cide & a small tidy-up
2018-09-27 11:29:44 +00:00
Add zones to evohome component (#18428) * Added Zones, and removed available() logic flesh out Zones tidy up init some more tidying up Nearly there - full functionality passed txo - ready to send PR Ready to PR, except to remove logging Add Zones and associated functionality to evohome component Add Zones to evohome (some more tidying up) Add Zones to evohome (Nearly there - full functionality) Add Zones to evohome (passed tox) Add Zones to evohome (except to remove logging) Add Zones and associated functionality to evohome component Revert _LOGGER.warn to .debug, as it should be Cleanup stupid REBASE * removed a duplicate/unwanted code block * tidy up comment * use async_added_to_hass instead of bus.listen * Pass evo_data instead of hass when instntiating * switch to async version of setup_platform/add_entities * Remove workaround for bug in client library - using github version for now, as awaiting new PyPi package * Avoid invalid-name lint - use 'zone_idx' instead of 'z' * Fix line too long error * remove commented-out line of code * fix a logic error, improve REDACTION of potentially-sensitive infomation * restore use of EVENT_HOMEASSISTANT_START to improve HA startup time * added a docstring to _flatten_json * Switch instantiation from component to platform * Use v0.2.8 of client api (resolves logging bug) * import rather than duplicate, and de-lint * We use evohomeclient v0.2.8 now * remove all the api logging * Changed scan_interal to Throttle * added a configurable scan_interval * small code tidy-up, removed sub-function * tidy up update() code * minimize use of self.hass.data[] * remove lint * remove unwanted logging * remove debug code * correct a small coding error * small tidyup of code * remove flatten_json * add @callback to _first_update() * switch back to load_platform * adhere to standards fro logging * use new format string formatting * minor change to comments * convert scan_interval to timedelta from int * restore rounding up of scan_interval * code tidy up * sync when in sync context * fix typo * remove raises not needed * tidy up typos, etc. * remove invalid-name lint * tidy up exception handling * de-lint/pretty-fy * move 'status' to a JSON node, so theirs room for 'config', 'schedule' in the future
2018-11-27 11:17:22 +00:00
REQUIREMENTS = ['evohomeclient==0.2.8']
Add (EU-based) Honeywell evohome CH/DHW controller (#16427) * Add support for Honeywell evohome CH/DHW systems More flake8 corrections Passes Flake8 tests Almost passed flake8.pylint! Passed all tox tests Now it needs serious testing! Almost ready to submit BUGFIX: DHW state now functional More improvements to available() Solved the DHW temp units problem! Last minute bug squash to improve dicts merge Trying to rebase fixing more rbase errors revert to creating HTTP_error_code internally for now ready to submit PR Added support for Honeywell evohome CH/DHW systems * Updated requirements_test_all.txt * Fix: D401 First line should be in imperative mood * Remove _LOGGER.info (replace with _LOGGER.debug) * raise PlatformNotReady when RequestException during setup() * Revert some LOGGER.debug to LOGGER.warning * Improved logging levels, and removed some unwanted comments * Improvments to logging - additional self._status info * BUGFIX: DHW wrongly showing available = False (and some other tweaks) * Fix trailing whitespace * Remove state_attributes override and API_VER code * Removed heating zones, DHW and heuristics to reduce # lines of code * Removed some more lines of code * Removed unused configuration parameters * Remove some more un-needed lines * Removed more (uneeded) lines of code & fixed two minor typos * Improvements to debug logging of available() = False * Improvements to code, and code clean-up * Corrected a minor typo * A small tidy up * reduces precision of emulated temps floats to 0.1 * Some code improvements as suggested by JeardM * Rewrite of exception handler * Removed another unwanted logging in properties * Remove async_ version of various methods * moved available heuristics to update() * Cleanup of code, and re-work linter hints * fixed a minor documentation typo * scan_interval is now no longer a configurable option * Change from Master/Slave to Parent/Child * Removed the last of the slaves * Removed the last of the masters * Move -PARALLEL_UPDATES to .\climate\evohome.py' * main code moved to climate/evohome.py * merge EvoEntity into EvoController class * remove should_poll (for now) * woops! left a hint in * removed icon * only log a WARNING the first time available = False * cleanup dodgy exception handling * Tidy up exception handling * Many changes as suggested by @MartinHjelmare, thanks * remove hass from init, part 1 * use async_added_to_hass instead of dispatcher_connect * remove hass from init, part 2 (done) * add 1-2 arrays, and tidied up some comments * from dispatcher to async_added_to_hass * cleaned up some logging, and removed others * Many changes as request by @MartinHjelmare * Homage to the lint * Changed to the HA of doing operating_mode * Now using update_before_add=True * reduced logging further still... * fixed minor lint * fix a small logic error * Add device_state_attributes to track actual operating mode * Clean up doc quotes caused by previous changes * Woops! removed some debug lines that shoudln't have stayed in * Add a complete set of device_state_attributes * Cleanup some constants * Remove more legacy code * domain_data to evo_data & this else should be a finally * minor change for readability * Minor change for readability #2 * removed unused code * small tidy up - no code changes * fix minor lint * Correct URLs & descriptions in docstring * whoops - fixed a typo in docstrings * remove an unused line of cide & a small tidy-up
2018-09-27 11:29:44 +00:00
_LOGGER = logging.getLogger(__name__)
DOMAIN = 'evohome'
DATA_EVOHOME = 'data_' + DOMAIN
Add zones to evohome component (#18428) * Added Zones, and removed available() logic flesh out Zones tidy up init some more tidying up Nearly there - full functionality passed txo - ready to send PR Ready to PR, except to remove logging Add Zones and associated functionality to evohome component Add Zones to evohome (some more tidying up) Add Zones to evohome (Nearly there - full functionality) Add Zones to evohome (passed tox) Add Zones to evohome (except to remove logging) Add Zones and associated functionality to evohome component Revert _LOGGER.warn to .debug, as it should be Cleanup stupid REBASE * removed a duplicate/unwanted code block * tidy up comment * use async_added_to_hass instead of bus.listen * Pass evo_data instead of hass when instntiating * switch to async version of setup_platform/add_entities * Remove workaround for bug in client library - using github version for now, as awaiting new PyPi package * Avoid invalid-name lint - use 'zone_idx' instead of 'z' * Fix line too long error * remove commented-out line of code * fix a logic error, improve REDACTION of potentially-sensitive infomation * restore use of EVENT_HOMEASSISTANT_START to improve HA startup time * added a docstring to _flatten_json * Switch instantiation from component to platform * Use v0.2.8 of client api (resolves logging bug) * import rather than duplicate, and de-lint * We use evohomeclient v0.2.8 now * remove all the api logging * Changed scan_interal to Throttle * added a configurable scan_interval * small code tidy-up, removed sub-function * tidy up update() code * minimize use of self.hass.data[] * remove lint * remove unwanted logging * remove debug code * correct a small coding error * small tidyup of code * remove flatten_json * add @callback to _first_update() * switch back to load_platform * adhere to standards fro logging * use new format string formatting * minor change to comments * convert scan_interval to timedelta from int * restore rounding up of scan_interval * code tidy up * sync when in sync context * fix typo * remove raises not needed * tidy up typos, etc. * remove invalid-name lint * tidy up exception handling * de-lint/pretty-fy * move 'status' to a JSON node, so theirs room for 'config', 'schedule' in the future
2018-11-27 11:17:22 +00:00
DISPATCHER_EVOHOME = 'dispatcher_' + DOMAIN
Add (EU-based) Honeywell evohome CH/DHW controller (#16427) * Add support for Honeywell evohome CH/DHW systems More flake8 corrections Passes Flake8 tests Almost passed flake8.pylint! Passed all tox tests Now it needs serious testing! Almost ready to submit BUGFIX: DHW state now functional More improvements to available() Solved the DHW temp units problem! Last minute bug squash to improve dicts merge Trying to rebase fixing more rbase errors revert to creating HTTP_error_code internally for now ready to submit PR Added support for Honeywell evohome CH/DHW systems * Updated requirements_test_all.txt * Fix: D401 First line should be in imperative mood * Remove _LOGGER.info (replace with _LOGGER.debug) * raise PlatformNotReady when RequestException during setup() * Revert some LOGGER.debug to LOGGER.warning * Improved logging levels, and removed some unwanted comments * Improvments to logging - additional self._status info * BUGFIX: DHW wrongly showing available = False (and some other tweaks) * Fix trailing whitespace * Remove state_attributes override and API_VER code * Removed heating zones, DHW and heuristics to reduce # lines of code * Removed some more lines of code * Removed unused configuration parameters * Remove some more un-needed lines * Removed more (uneeded) lines of code & fixed two minor typos * Improvements to debug logging of available() = False * Improvements to code, and code clean-up * Corrected a minor typo * A small tidy up * reduces precision of emulated temps floats to 0.1 * Some code improvements as suggested by JeardM * Rewrite of exception handler * Removed another unwanted logging in properties * Remove async_ version of various methods * moved available heuristics to update() * Cleanup of code, and re-work linter hints * fixed a minor documentation typo * scan_interval is now no longer a configurable option * Change from Master/Slave to Parent/Child * Removed the last of the slaves * Removed the last of the masters * Move -PARALLEL_UPDATES to .\climate\evohome.py' * main code moved to climate/evohome.py * merge EvoEntity into EvoController class * remove should_poll (for now) * woops! left a hint in * removed icon * only log a WARNING the first time available = False * cleanup dodgy exception handling * Tidy up exception handling * Many changes as suggested by @MartinHjelmare, thanks * remove hass from init, part 1 * use async_added_to_hass instead of dispatcher_connect * remove hass from init, part 2 (done) * add 1-2 arrays, and tidied up some comments * from dispatcher to async_added_to_hass * cleaned up some logging, and removed others * Many changes as request by @MartinHjelmare * Homage to the lint * Changed to the HA of doing operating_mode * Now using update_before_add=True * reduced logging further still... * fixed minor lint * fix a small logic error * Add device_state_attributes to track actual operating mode * Clean up doc quotes caused by previous changes * Woops! removed some debug lines that shoudln't have stayed in * Add a complete set of device_state_attributes * Cleanup some constants * Remove more legacy code * domain_data to evo_data & this else should be a finally * minor change for readability * Minor change for readability #2 * removed unused code * small tidy up - no code changes * fix minor lint * Correct URLs & descriptions in docstring * whoops - fixed a typo in docstrings * remove an unused line of cide & a small tidy-up
2018-09-27 11:29:44 +00:00
CONF_LOCATION_IDX = 'location_idx'
Add zones to evohome component (#18428) * Added Zones, and removed available() logic flesh out Zones tidy up init some more tidying up Nearly there - full functionality passed txo - ready to send PR Ready to PR, except to remove logging Add Zones and associated functionality to evohome component Add Zones to evohome (some more tidying up) Add Zones to evohome (Nearly there - full functionality) Add Zones to evohome (passed tox) Add Zones to evohome (except to remove logging) Add Zones and associated functionality to evohome component Revert _LOGGER.warn to .debug, as it should be Cleanup stupid REBASE * removed a duplicate/unwanted code block * tidy up comment * use async_added_to_hass instead of bus.listen * Pass evo_data instead of hass when instntiating * switch to async version of setup_platform/add_entities * Remove workaround for bug in client library - using github version for now, as awaiting new PyPi package * Avoid invalid-name lint - use 'zone_idx' instead of 'z' * Fix line too long error * remove commented-out line of code * fix a logic error, improve REDACTION of potentially-sensitive infomation * restore use of EVENT_HOMEASSISTANT_START to improve HA startup time * added a docstring to _flatten_json * Switch instantiation from component to platform * Use v0.2.8 of client api (resolves logging bug) * import rather than duplicate, and de-lint * We use evohomeclient v0.2.8 now * remove all the api logging * Changed scan_interal to Throttle * added a configurable scan_interval * small code tidy-up, removed sub-function * tidy up update() code * minimize use of self.hass.data[] * remove lint * remove unwanted logging * remove debug code * correct a small coding error * small tidyup of code * remove flatten_json * add @callback to _first_update() * switch back to load_platform * adhere to standards fro logging * use new format string formatting * minor change to comments * convert scan_interval to timedelta from int * restore rounding up of scan_interval * code tidy up * sync when in sync context * fix typo * remove raises not needed * tidy up typos, etc. * remove invalid-name lint * tidy up exception handling * de-lint/pretty-fy * move 'status' to a JSON node, so theirs room for 'config', 'schedule' in the future
2018-11-27 11:17:22 +00:00
SCAN_INTERVAL_DEFAULT = timedelta(seconds=300)
SCAN_INTERVAL_MINIMUM = timedelta(seconds=180)
Add (EU-based) Honeywell evohome CH/DHW controller (#16427) * Add support for Honeywell evohome CH/DHW systems More flake8 corrections Passes Flake8 tests Almost passed flake8.pylint! Passed all tox tests Now it needs serious testing! Almost ready to submit BUGFIX: DHW state now functional More improvements to available() Solved the DHW temp units problem! Last minute bug squash to improve dicts merge Trying to rebase fixing more rbase errors revert to creating HTTP_error_code internally for now ready to submit PR Added support for Honeywell evohome CH/DHW systems * Updated requirements_test_all.txt * Fix: D401 First line should be in imperative mood * Remove _LOGGER.info (replace with _LOGGER.debug) * raise PlatformNotReady when RequestException during setup() * Revert some LOGGER.debug to LOGGER.warning * Improved logging levels, and removed some unwanted comments * Improvments to logging - additional self._status info * BUGFIX: DHW wrongly showing available = False (and some other tweaks) * Fix trailing whitespace * Remove state_attributes override and API_VER code * Removed heating zones, DHW and heuristics to reduce # lines of code * Removed some more lines of code * Removed unused configuration parameters * Remove some more un-needed lines * Removed more (uneeded) lines of code & fixed two minor typos * Improvements to debug logging of available() = False * Improvements to code, and code clean-up * Corrected a minor typo * A small tidy up * reduces precision of emulated temps floats to 0.1 * Some code improvements as suggested by JeardM * Rewrite of exception handler * Removed another unwanted logging in properties * Remove async_ version of various methods * moved available heuristics to update() * Cleanup of code, and re-work linter hints * fixed a minor documentation typo * scan_interval is now no longer a configurable option * Change from Master/Slave to Parent/Child * Removed the last of the slaves * Removed the last of the masters * Move -PARALLEL_UPDATES to .\climate\evohome.py' * main code moved to climate/evohome.py * merge EvoEntity into EvoController class * remove should_poll (for now) * woops! left a hint in * removed icon * only log a WARNING the first time available = False * cleanup dodgy exception handling * Tidy up exception handling * Many changes as suggested by @MartinHjelmare, thanks * remove hass from init, part 1 * use async_added_to_hass instead of dispatcher_connect * remove hass from init, part 2 (done) * add 1-2 arrays, and tidied up some comments * from dispatcher to async_added_to_hass * cleaned up some logging, and removed others * Many changes as request by @MartinHjelmare * Homage to the lint * Changed to the HA of doing operating_mode * Now using update_before_add=True * reduced logging further still... * fixed minor lint * fix a small logic error * Add device_state_attributes to track actual operating mode * Clean up doc quotes caused by previous changes * Woops! removed some debug lines that shoudln't have stayed in * Add a complete set of device_state_attributes * Cleanup some constants * Remove more legacy code * domain_data to evo_data & this else should be a finally * minor change for readability * Minor change for readability #2 * removed unused code * small tidy up - no code changes * fix minor lint * Correct URLs & descriptions in docstring * whoops - fixed a typo in docstrings * remove an unused line of cide & a small tidy-up
2018-09-27 11:29:44 +00:00
CONFIG_SCHEMA = vol.Schema({
DOMAIN: vol.Schema({
vol.Required(CONF_USERNAME): cv.string,
vol.Required(CONF_PASSWORD): cv.string,
Add zones to evohome component (#18428) * Added Zones, and removed available() logic flesh out Zones tidy up init some more tidying up Nearly there - full functionality passed txo - ready to send PR Ready to PR, except to remove logging Add Zones and associated functionality to evohome component Add Zones to evohome (some more tidying up) Add Zones to evohome (Nearly there - full functionality) Add Zones to evohome (passed tox) Add Zones to evohome (except to remove logging) Add Zones and associated functionality to evohome component Revert _LOGGER.warn to .debug, as it should be Cleanup stupid REBASE * removed a duplicate/unwanted code block * tidy up comment * use async_added_to_hass instead of bus.listen * Pass evo_data instead of hass when instntiating * switch to async version of setup_platform/add_entities * Remove workaround for bug in client library - using github version for now, as awaiting new PyPi package * Avoid invalid-name lint - use 'zone_idx' instead of 'z' * Fix line too long error * remove commented-out line of code * fix a logic error, improve REDACTION of potentially-sensitive infomation * restore use of EVENT_HOMEASSISTANT_START to improve HA startup time * added a docstring to _flatten_json * Switch instantiation from component to platform * Use v0.2.8 of client api (resolves logging bug) * import rather than duplicate, and de-lint * We use evohomeclient v0.2.8 now * remove all the api logging * Changed scan_interal to Throttle * added a configurable scan_interval * small code tidy-up, removed sub-function * tidy up update() code * minimize use of self.hass.data[] * remove lint * remove unwanted logging * remove debug code * correct a small coding error * small tidyup of code * remove flatten_json * add @callback to _first_update() * switch back to load_platform * adhere to standards fro logging * use new format string formatting * minor change to comments * convert scan_interval to timedelta from int * restore rounding up of scan_interval * code tidy up * sync when in sync context * fix typo * remove raises not needed * tidy up typos, etc. * remove invalid-name lint * tidy up exception handling * de-lint/pretty-fy * move 'status' to a JSON node, so theirs room for 'config', 'schedule' in the future
2018-11-27 11:17:22 +00:00
vol.Optional(CONF_LOCATION_IDX, default=0):
cv.positive_int,
vol.Optional(CONF_SCAN_INTERVAL, default=SCAN_INTERVAL_DEFAULT):
vol.All(cv.time_period, vol.Range(min=SCAN_INTERVAL_MINIMUM)),
Add (EU-based) Honeywell evohome CH/DHW controller (#16427) * Add support for Honeywell evohome CH/DHW systems More flake8 corrections Passes Flake8 tests Almost passed flake8.pylint! Passed all tox tests Now it needs serious testing! Almost ready to submit BUGFIX: DHW state now functional More improvements to available() Solved the DHW temp units problem! Last minute bug squash to improve dicts merge Trying to rebase fixing more rbase errors revert to creating HTTP_error_code internally for now ready to submit PR Added support for Honeywell evohome CH/DHW systems * Updated requirements_test_all.txt * Fix: D401 First line should be in imperative mood * Remove _LOGGER.info (replace with _LOGGER.debug) * raise PlatformNotReady when RequestException during setup() * Revert some LOGGER.debug to LOGGER.warning * Improved logging levels, and removed some unwanted comments * Improvments to logging - additional self._status info * BUGFIX: DHW wrongly showing available = False (and some other tweaks) * Fix trailing whitespace * Remove state_attributes override and API_VER code * Removed heating zones, DHW and heuristics to reduce # lines of code * Removed some more lines of code * Removed unused configuration parameters * Remove some more un-needed lines * Removed more (uneeded) lines of code & fixed two minor typos * Improvements to debug logging of available() = False * Improvements to code, and code clean-up * Corrected a minor typo * A small tidy up * reduces precision of emulated temps floats to 0.1 * Some code improvements as suggested by JeardM * Rewrite of exception handler * Removed another unwanted logging in properties * Remove async_ version of various methods * moved available heuristics to update() * Cleanup of code, and re-work linter hints * fixed a minor documentation typo * scan_interval is now no longer a configurable option * Change from Master/Slave to Parent/Child * Removed the last of the slaves * Removed the last of the masters * Move -PARALLEL_UPDATES to .\climate\evohome.py' * main code moved to climate/evohome.py * merge EvoEntity into EvoController class * remove should_poll (for now) * woops! left a hint in * removed icon * only log a WARNING the first time available = False * cleanup dodgy exception handling * Tidy up exception handling * Many changes as suggested by @MartinHjelmare, thanks * remove hass from init, part 1 * use async_added_to_hass instead of dispatcher_connect * remove hass from init, part 2 (done) * add 1-2 arrays, and tidied up some comments * from dispatcher to async_added_to_hass * cleaned up some logging, and removed others * Many changes as request by @MartinHjelmare * Homage to the lint * Changed to the HA of doing operating_mode * Now using update_before_add=True * reduced logging further still... * fixed minor lint * fix a small logic error * Add device_state_attributes to track actual operating mode * Clean up doc quotes caused by previous changes * Woops! removed some debug lines that shoudln't have stayed in * Add a complete set of device_state_attributes * Cleanup some constants * Remove more legacy code * domain_data to evo_data & this else should be a finally * minor change for readability * Minor change for readability #2 * removed unused code * small tidy up - no code changes * fix minor lint * Correct URLs & descriptions in docstring * whoops - fixed a typo in docstrings * remove an unused line of cide & a small tidy-up
2018-09-27 11:29:44 +00:00
}),
}, extra=vol.ALLOW_EXTRA)
# These are used to help prevent E501 (line too long) violations.
GWS = 'gateways'
TCS = 'temperatureControlSystems'
Add zones to evohome component (#18428) * Added Zones, and removed available() logic flesh out Zones tidy up init some more tidying up Nearly there - full functionality passed txo - ready to send PR Ready to PR, except to remove logging Add Zones and associated functionality to evohome component Add Zones to evohome (some more tidying up) Add Zones to evohome (Nearly there - full functionality) Add Zones to evohome (passed tox) Add Zones to evohome (except to remove logging) Add Zones and associated functionality to evohome component Revert _LOGGER.warn to .debug, as it should be Cleanup stupid REBASE * removed a duplicate/unwanted code block * tidy up comment * use async_added_to_hass instead of bus.listen * Pass evo_data instead of hass when instntiating * switch to async version of setup_platform/add_entities * Remove workaround for bug in client library - using github version for now, as awaiting new PyPi package * Avoid invalid-name lint - use 'zone_idx' instead of 'z' * Fix line too long error * remove commented-out line of code * fix a logic error, improve REDACTION of potentially-sensitive infomation * restore use of EVENT_HOMEASSISTANT_START to improve HA startup time * added a docstring to _flatten_json * Switch instantiation from component to platform * Use v0.2.8 of client api (resolves logging bug) * import rather than duplicate, and de-lint * We use evohomeclient v0.2.8 now * remove all the api logging * Changed scan_interal to Throttle * added a configurable scan_interval * small code tidy-up, removed sub-function * tidy up update() code * minimize use of self.hass.data[] * remove lint * remove unwanted logging * remove debug code * correct a small coding error * small tidyup of code * remove flatten_json * add @callback to _first_update() * switch back to load_platform * adhere to standards fro logging * use new format string formatting * minor change to comments * convert scan_interval to timedelta from int * restore rounding up of scan_interval * code tidy up * sync when in sync context * fix typo * remove raises not needed * tidy up typos, etc. * remove invalid-name lint * tidy up exception handling * de-lint/pretty-fy * move 'status' to a JSON node, so theirs room for 'config', 'schedule' in the future
2018-11-27 11:17:22 +00:00
# bit masks for dispatcher packets
EVO_PARENT = 0x01
EVO_CHILD = 0x02
Add (EU-based) Honeywell evohome CH/DHW controller (#16427) * Add support for Honeywell evohome CH/DHW systems More flake8 corrections Passes Flake8 tests Almost passed flake8.pylint! Passed all tox tests Now it needs serious testing! Almost ready to submit BUGFIX: DHW state now functional More improvements to available() Solved the DHW temp units problem! Last minute bug squash to improve dicts merge Trying to rebase fixing more rbase errors revert to creating HTTP_error_code internally for now ready to submit PR Added support for Honeywell evohome CH/DHW systems * Updated requirements_test_all.txt * Fix: D401 First line should be in imperative mood * Remove _LOGGER.info (replace with _LOGGER.debug) * raise PlatformNotReady when RequestException during setup() * Revert some LOGGER.debug to LOGGER.warning * Improved logging levels, and removed some unwanted comments * Improvments to logging - additional self._status info * BUGFIX: DHW wrongly showing available = False (and some other tweaks) * Fix trailing whitespace * Remove state_attributes override and API_VER code * Removed heating zones, DHW and heuristics to reduce # lines of code * Removed some more lines of code * Removed unused configuration parameters * Remove some more un-needed lines * Removed more (uneeded) lines of code & fixed two minor typos * Improvements to debug logging of available() = False * Improvements to code, and code clean-up * Corrected a minor typo * A small tidy up * reduces precision of emulated temps floats to 0.1 * Some code improvements as suggested by JeardM * Rewrite of exception handler * Removed another unwanted logging in properties * Remove async_ version of various methods * moved available heuristics to update() * Cleanup of code, and re-work linter hints * fixed a minor documentation typo * scan_interval is now no longer a configurable option * Change from Master/Slave to Parent/Child * Removed the last of the slaves * Removed the last of the masters * Move -PARALLEL_UPDATES to .\climate\evohome.py' * main code moved to climate/evohome.py * merge EvoEntity into EvoController class * remove should_poll (for now) * woops! left a hint in * removed icon * only log a WARNING the first time available = False * cleanup dodgy exception handling * Tidy up exception handling * Many changes as suggested by @MartinHjelmare, thanks * remove hass from init, part 1 * use async_added_to_hass instead of dispatcher_connect * remove hass from init, part 2 (done) * add 1-2 arrays, and tidied up some comments * from dispatcher to async_added_to_hass * cleaned up some logging, and removed others * Many changes as request by @MartinHjelmare * Homage to the lint * Changed to the HA of doing operating_mode * Now using update_before_add=True * reduced logging further still... * fixed minor lint * fix a small logic error * Add device_state_attributes to track actual operating mode * Clean up doc quotes caused by previous changes * Woops! removed some debug lines that shoudln't have stayed in * Add a complete set of device_state_attributes * Cleanup some constants * Remove more legacy code * domain_data to evo_data & this else should be a finally * minor change for readability * Minor change for readability #2 * removed unused code * small tidy up - no code changes * fix minor lint * Correct URLs & descriptions in docstring * whoops - fixed a typo in docstrings * remove an unused line of cide & a small tidy-up
2018-09-27 11:29:44 +00:00
Add zones to evohome component (#18428) * Added Zones, and removed available() logic flesh out Zones tidy up init some more tidying up Nearly there - full functionality passed txo - ready to send PR Ready to PR, except to remove logging Add Zones and associated functionality to evohome component Add Zones to evohome (some more tidying up) Add Zones to evohome (Nearly there - full functionality) Add Zones to evohome (passed tox) Add Zones to evohome (except to remove logging) Add Zones and associated functionality to evohome component Revert _LOGGER.warn to .debug, as it should be Cleanup stupid REBASE * removed a duplicate/unwanted code block * tidy up comment * use async_added_to_hass instead of bus.listen * Pass evo_data instead of hass when instntiating * switch to async version of setup_platform/add_entities * Remove workaround for bug in client library - using github version for now, as awaiting new PyPi package * Avoid invalid-name lint - use 'zone_idx' instead of 'z' * Fix line too long error * remove commented-out line of code * fix a logic error, improve REDACTION of potentially-sensitive infomation * restore use of EVENT_HOMEASSISTANT_START to improve HA startup time * added a docstring to _flatten_json * Switch instantiation from component to platform * Use v0.2.8 of client api (resolves logging bug) * import rather than duplicate, and de-lint * We use evohomeclient v0.2.8 now * remove all the api logging * Changed scan_interal to Throttle * added a configurable scan_interval * small code tidy-up, removed sub-function * tidy up update() code * minimize use of self.hass.data[] * remove lint * remove unwanted logging * remove debug code * correct a small coding error * small tidyup of code * remove flatten_json * add @callback to _first_update() * switch back to load_platform * adhere to standards fro logging * use new format string formatting * minor change to comments * convert scan_interval to timedelta from int * restore rounding up of scan_interval * code tidy up * sync when in sync context * fix typo * remove raises not needed * tidy up typos, etc. * remove invalid-name lint * tidy up exception handling * de-lint/pretty-fy * move 'status' to a JSON node, so theirs room for 'config', 'schedule' in the future
2018-11-27 11:17:22 +00:00
def setup(hass, hass_config):
"""Create a (EMEA/EU-based) Honeywell evohome system.
Add (EU-based) Honeywell evohome CH/DHW controller (#16427) * Add support for Honeywell evohome CH/DHW systems More flake8 corrections Passes Flake8 tests Almost passed flake8.pylint! Passed all tox tests Now it needs serious testing! Almost ready to submit BUGFIX: DHW state now functional More improvements to available() Solved the DHW temp units problem! Last minute bug squash to improve dicts merge Trying to rebase fixing more rbase errors revert to creating HTTP_error_code internally for now ready to submit PR Added support for Honeywell evohome CH/DHW systems * Updated requirements_test_all.txt * Fix: D401 First line should be in imperative mood * Remove _LOGGER.info (replace with _LOGGER.debug) * raise PlatformNotReady when RequestException during setup() * Revert some LOGGER.debug to LOGGER.warning * Improved logging levels, and removed some unwanted comments * Improvments to logging - additional self._status info * BUGFIX: DHW wrongly showing available = False (and some other tweaks) * Fix trailing whitespace * Remove state_attributes override and API_VER code * Removed heating zones, DHW and heuristics to reduce # lines of code * Removed some more lines of code * Removed unused configuration parameters * Remove some more un-needed lines * Removed more (uneeded) lines of code & fixed two minor typos * Improvements to debug logging of available() = False * Improvements to code, and code clean-up * Corrected a minor typo * A small tidy up * reduces precision of emulated temps floats to 0.1 * Some code improvements as suggested by JeardM * Rewrite of exception handler * Removed another unwanted logging in properties * Remove async_ version of various methods * moved available heuristics to update() * Cleanup of code, and re-work linter hints * fixed a minor documentation typo * scan_interval is now no longer a configurable option * Change from Master/Slave to Parent/Child * Removed the last of the slaves * Removed the last of the masters * Move -PARALLEL_UPDATES to .\climate\evohome.py' * main code moved to climate/evohome.py * merge EvoEntity into EvoController class * remove should_poll (for now) * woops! left a hint in * removed icon * only log a WARNING the first time available = False * cleanup dodgy exception handling * Tidy up exception handling * Many changes as suggested by @MartinHjelmare, thanks * remove hass from init, part 1 * use async_added_to_hass instead of dispatcher_connect * remove hass from init, part 2 (done) * add 1-2 arrays, and tidied up some comments * from dispatcher to async_added_to_hass * cleaned up some logging, and removed others * Many changes as request by @MartinHjelmare * Homage to the lint * Changed to the HA of doing operating_mode * Now using update_before_add=True * reduced logging further still... * fixed minor lint * fix a small logic error * Add device_state_attributes to track actual operating mode * Clean up doc quotes caused by previous changes * Woops! removed some debug lines that shoudln't have stayed in * Add a complete set of device_state_attributes * Cleanup some constants * Remove more legacy code * domain_data to evo_data & this else should be a finally * minor change for readability * Minor change for readability #2 * removed unused code * small tidy up - no code changes * fix minor lint * Correct URLs & descriptions in docstring * whoops - fixed a typo in docstrings * remove an unused line of cide & a small tidy-up
2018-09-27 11:29:44 +00:00
Add zones to evohome component (#18428) * Added Zones, and removed available() logic flesh out Zones tidy up init some more tidying up Nearly there - full functionality passed txo - ready to send PR Ready to PR, except to remove logging Add Zones and associated functionality to evohome component Add Zones to evohome (some more tidying up) Add Zones to evohome (Nearly there - full functionality) Add Zones to evohome (passed tox) Add Zones to evohome (except to remove logging) Add Zones and associated functionality to evohome component Revert _LOGGER.warn to .debug, as it should be Cleanup stupid REBASE * removed a duplicate/unwanted code block * tidy up comment * use async_added_to_hass instead of bus.listen * Pass evo_data instead of hass when instntiating * switch to async version of setup_platform/add_entities * Remove workaround for bug in client library - using github version for now, as awaiting new PyPi package * Avoid invalid-name lint - use 'zone_idx' instead of 'z' * Fix line too long error * remove commented-out line of code * fix a logic error, improve REDACTION of potentially-sensitive infomation * restore use of EVENT_HOMEASSISTANT_START to improve HA startup time * added a docstring to _flatten_json * Switch instantiation from component to platform * Use v0.2.8 of client api (resolves logging bug) * import rather than duplicate, and de-lint * We use evohomeclient v0.2.8 now * remove all the api logging * Changed scan_interal to Throttle * added a configurable scan_interval * small code tidy-up, removed sub-function * tidy up update() code * minimize use of self.hass.data[] * remove lint * remove unwanted logging * remove debug code * correct a small coding error * small tidyup of code * remove flatten_json * add @callback to _first_update() * switch back to load_platform * adhere to standards fro logging * use new format string formatting * minor change to comments * convert scan_interval to timedelta from int * restore rounding up of scan_interval * code tidy up * sync when in sync context * fix typo * remove raises not needed * tidy up typos, etc. * remove invalid-name lint * tidy up exception handling * de-lint/pretty-fy * move 'status' to a JSON node, so theirs room for 'config', 'schedule' in the future
2018-11-27 11:17:22 +00:00
Currently, only the Controller and the Zones are implemented here.
Add (EU-based) Honeywell evohome CH/DHW controller (#16427) * Add support for Honeywell evohome CH/DHW systems More flake8 corrections Passes Flake8 tests Almost passed flake8.pylint! Passed all tox tests Now it needs serious testing! Almost ready to submit BUGFIX: DHW state now functional More improvements to available() Solved the DHW temp units problem! Last minute bug squash to improve dicts merge Trying to rebase fixing more rbase errors revert to creating HTTP_error_code internally for now ready to submit PR Added support for Honeywell evohome CH/DHW systems * Updated requirements_test_all.txt * Fix: D401 First line should be in imperative mood * Remove _LOGGER.info (replace with _LOGGER.debug) * raise PlatformNotReady when RequestException during setup() * Revert some LOGGER.debug to LOGGER.warning * Improved logging levels, and removed some unwanted comments * Improvments to logging - additional self._status info * BUGFIX: DHW wrongly showing available = False (and some other tweaks) * Fix trailing whitespace * Remove state_attributes override and API_VER code * Removed heating zones, DHW and heuristics to reduce # lines of code * Removed some more lines of code * Removed unused configuration parameters * Remove some more un-needed lines * Removed more (uneeded) lines of code & fixed two minor typos * Improvements to debug logging of available() = False * Improvements to code, and code clean-up * Corrected a minor typo * A small tidy up * reduces precision of emulated temps floats to 0.1 * Some code improvements as suggested by JeardM * Rewrite of exception handler * Removed another unwanted logging in properties * Remove async_ version of various methods * moved available heuristics to update() * Cleanup of code, and re-work linter hints * fixed a minor documentation typo * scan_interval is now no longer a configurable option * Change from Master/Slave to Parent/Child * Removed the last of the slaves * Removed the last of the masters * Move -PARALLEL_UPDATES to .\climate\evohome.py' * main code moved to climate/evohome.py * merge EvoEntity into EvoController class * remove should_poll (for now) * woops! left a hint in * removed icon * only log a WARNING the first time available = False * cleanup dodgy exception handling * Tidy up exception handling * Many changes as suggested by @MartinHjelmare, thanks * remove hass from init, part 1 * use async_added_to_hass instead of dispatcher_connect * remove hass from init, part 2 (done) * add 1-2 arrays, and tidied up some comments * from dispatcher to async_added_to_hass * cleaned up some logging, and removed others * Many changes as request by @MartinHjelmare * Homage to the lint * Changed to the HA of doing operating_mode * Now using update_before_add=True * reduced logging further still... * fixed minor lint * fix a small logic error * Add device_state_attributes to track actual operating mode * Clean up doc quotes caused by previous changes * Woops! removed some debug lines that shoudln't have stayed in * Add a complete set of device_state_attributes * Cleanup some constants * Remove more legacy code * domain_data to evo_data & this else should be a finally * minor change for readability * Minor change for readability #2 * removed unused code * small tidy up - no code changes * fix minor lint * Correct URLs & descriptions in docstring * whoops - fixed a typo in docstrings * remove an unused line of cide & a small tidy-up
2018-09-27 11:29:44 +00:00
"""
evo_data = hass.data[DATA_EVOHOME] = {}
evo_data['timers'] = {}
Add zones to evohome component (#18428) * Added Zones, and removed available() logic flesh out Zones tidy up init some more tidying up Nearly there - full functionality passed txo - ready to send PR Ready to PR, except to remove logging Add Zones and associated functionality to evohome component Add Zones to evohome (some more tidying up) Add Zones to evohome (Nearly there - full functionality) Add Zones to evohome (passed tox) Add Zones to evohome (except to remove logging) Add Zones and associated functionality to evohome component Revert _LOGGER.warn to .debug, as it should be Cleanup stupid REBASE * removed a duplicate/unwanted code block * tidy up comment * use async_added_to_hass instead of bus.listen * Pass evo_data instead of hass when instntiating * switch to async version of setup_platform/add_entities * Remove workaround for bug in client library - using github version for now, as awaiting new PyPi package * Avoid invalid-name lint - use 'zone_idx' instead of 'z' * Fix line too long error * remove commented-out line of code * fix a logic error, improve REDACTION of potentially-sensitive infomation * restore use of EVENT_HOMEASSISTANT_START to improve HA startup time * added a docstring to _flatten_json * Switch instantiation from component to platform * Use v0.2.8 of client api (resolves logging bug) * import rather than duplicate, and de-lint * We use evohomeclient v0.2.8 now * remove all the api logging * Changed scan_interal to Throttle * added a configurable scan_interval * small code tidy-up, removed sub-function * tidy up update() code * minimize use of self.hass.data[] * remove lint * remove unwanted logging * remove debug code * correct a small coding error * small tidyup of code * remove flatten_json * add @callback to _first_update() * switch back to load_platform * adhere to standards fro logging * use new format string formatting * minor change to comments * convert scan_interval to timedelta from int * restore rounding up of scan_interval * code tidy up * sync when in sync context * fix typo * remove raises not needed * tidy up typos, etc. * remove invalid-name lint * tidy up exception handling * de-lint/pretty-fy * move 'status' to a JSON node, so theirs room for 'config', 'schedule' in the future
2018-11-27 11:17:22 +00:00
# use a copy, since scan_interval is rounded up to nearest 60s
evo_data['params'] = dict(hass_config[DOMAIN])
scan_interval = evo_data['params'][CONF_SCAN_INTERVAL]
scan_interval = timedelta(
minutes=(scan_interval.total_seconds() + 59) // 60)
Add (EU-based) Honeywell evohome CH/DHW controller (#16427) * Add support for Honeywell evohome CH/DHW systems More flake8 corrections Passes Flake8 tests Almost passed flake8.pylint! Passed all tox tests Now it needs serious testing! Almost ready to submit BUGFIX: DHW state now functional More improvements to available() Solved the DHW temp units problem! Last minute bug squash to improve dicts merge Trying to rebase fixing more rbase errors revert to creating HTTP_error_code internally for now ready to submit PR Added support for Honeywell evohome CH/DHW systems * Updated requirements_test_all.txt * Fix: D401 First line should be in imperative mood * Remove _LOGGER.info (replace with _LOGGER.debug) * raise PlatformNotReady when RequestException during setup() * Revert some LOGGER.debug to LOGGER.warning * Improved logging levels, and removed some unwanted comments * Improvments to logging - additional self._status info * BUGFIX: DHW wrongly showing available = False (and some other tweaks) * Fix trailing whitespace * Remove state_attributes override and API_VER code * Removed heating zones, DHW and heuristics to reduce # lines of code * Removed some more lines of code * Removed unused configuration parameters * Remove some more un-needed lines * Removed more (uneeded) lines of code & fixed two minor typos * Improvements to debug logging of available() = False * Improvements to code, and code clean-up * Corrected a minor typo * A small tidy up * reduces precision of emulated temps floats to 0.1 * Some code improvements as suggested by JeardM * Rewrite of exception handler * Removed another unwanted logging in properties * Remove async_ version of various methods * moved available heuristics to update() * Cleanup of code, and re-work linter hints * fixed a minor documentation typo * scan_interval is now no longer a configurable option * Change from Master/Slave to Parent/Child * Removed the last of the slaves * Removed the last of the masters * Move -PARALLEL_UPDATES to .\climate\evohome.py' * main code moved to climate/evohome.py * merge EvoEntity into EvoController class * remove should_poll (for now) * woops! left a hint in * removed icon * only log a WARNING the first time available = False * cleanup dodgy exception handling * Tidy up exception handling * Many changes as suggested by @MartinHjelmare, thanks * remove hass from init, part 1 * use async_added_to_hass instead of dispatcher_connect * remove hass from init, part 2 (done) * add 1-2 arrays, and tidied up some comments * from dispatcher to async_added_to_hass * cleaned up some logging, and removed others * Many changes as request by @MartinHjelmare * Homage to the lint * Changed to the HA of doing operating_mode * Now using update_before_add=True * reduced logging further still... * fixed minor lint * fix a small logic error * Add device_state_attributes to track actual operating mode * Clean up doc quotes caused by previous changes * Woops! removed some debug lines that shoudln't have stayed in * Add a complete set of device_state_attributes * Cleanup some constants * Remove more legacy code * domain_data to evo_data & this else should be a finally * minor change for readability * Minor change for readability #2 * removed unused code * small tidy up - no code changes * fix minor lint * Correct URLs & descriptions in docstring * whoops - fixed a typo in docstrings * remove an unused line of cide & a small tidy-up
2018-09-27 11:29:44 +00:00
from evohomeclient2 import EvohomeClient
try:
client = EvohomeClient(
evo_data['params'][CONF_USERNAME],
evo_data['params'][CONF_PASSWORD],
debug=False
)
except HTTPError as err:
if err.response.status_code == HTTP_BAD_REQUEST:
_LOGGER.error(
Add zones to evohome component (#18428) * Added Zones, and removed available() logic flesh out Zones tidy up init some more tidying up Nearly there - full functionality passed txo - ready to send PR Ready to PR, except to remove logging Add Zones and associated functionality to evohome component Add Zones to evohome (some more tidying up) Add Zones to evohome (Nearly there - full functionality) Add Zones to evohome (passed tox) Add Zones to evohome (except to remove logging) Add Zones and associated functionality to evohome component Revert _LOGGER.warn to .debug, as it should be Cleanup stupid REBASE * removed a duplicate/unwanted code block * tidy up comment * use async_added_to_hass instead of bus.listen * Pass evo_data instead of hass when instntiating * switch to async version of setup_platform/add_entities * Remove workaround for bug in client library - using github version for now, as awaiting new PyPi package * Avoid invalid-name lint - use 'zone_idx' instead of 'z' * Fix line too long error * remove commented-out line of code * fix a logic error, improve REDACTION of potentially-sensitive infomation * restore use of EVENT_HOMEASSISTANT_START to improve HA startup time * added a docstring to _flatten_json * Switch instantiation from component to platform * Use v0.2.8 of client api (resolves logging bug) * import rather than duplicate, and de-lint * We use evohomeclient v0.2.8 now * remove all the api logging * Changed scan_interal to Throttle * added a configurable scan_interval * small code tidy-up, removed sub-function * tidy up update() code * minimize use of self.hass.data[] * remove lint * remove unwanted logging * remove debug code * correct a small coding error * small tidyup of code * remove flatten_json * add @callback to _first_update() * switch back to load_platform * adhere to standards fro logging * use new format string formatting * minor change to comments * convert scan_interval to timedelta from int * restore rounding up of scan_interval * code tidy up * sync when in sync context * fix typo * remove raises not needed * tidy up typos, etc. * remove invalid-name lint * tidy up exception handling * de-lint/pretty-fy * move 'status' to a JSON node, so theirs room for 'config', 'schedule' in the future
2018-11-27 11:17:22 +00:00
"setup(): Failed to connect with the vendor's web servers. "
Add (EU-based) Honeywell evohome CH/DHW controller (#16427) * Add support for Honeywell evohome CH/DHW systems More flake8 corrections Passes Flake8 tests Almost passed flake8.pylint! Passed all tox tests Now it needs serious testing! Almost ready to submit BUGFIX: DHW state now functional More improvements to available() Solved the DHW temp units problem! Last minute bug squash to improve dicts merge Trying to rebase fixing more rbase errors revert to creating HTTP_error_code internally for now ready to submit PR Added support for Honeywell evohome CH/DHW systems * Updated requirements_test_all.txt * Fix: D401 First line should be in imperative mood * Remove _LOGGER.info (replace with _LOGGER.debug) * raise PlatformNotReady when RequestException during setup() * Revert some LOGGER.debug to LOGGER.warning * Improved logging levels, and removed some unwanted comments * Improvments to logging - additional self._status info * BUGFIX: DHW wrongly showing available = False (and some other tweaks) * Fix trailing whitespace * Remove state_attributes override and API_VER code * Removed heating zones, DHW and heuristics to reduce # lines of code * Removed some more lines of code * Removed unused configuration parameters * Remove some more un-needed lines * Removed more (uneeded) lines of code & fixed two minor typos * Improvements to debug logging of available() = False * Improvements to code, and code clean-up * Corrected a minor typo * A small tidy up * reduces precision of emulated temps floats to 0.1 * Some code improvements as suggested by JeardM * Rewrite of exception handler * Removed another unwanted logging in properties * Remove async_ version of various methods * moved available heuristics to update() * Cleanup of code, and re-work linter hints * fixed a minor documentation typo * scan_interval is now no longer a configurable option * Change from Master/Slave to Parent/Child * Removed the last of the slaves * Removed the last of the masters * Move -PARALLEL_UPDATES to .\climate\evohome.py' * main code moved to climate/evohome.py * merge EvoEntity into EvoController class * remove should_poll (for now) * woops! left a hint in * removed icon * only log a WARNING the first time available = False * cleanup dodgy exception handling * Tidy up exception handling * Many changes as suggested by @MartinHjelmare, thanks * remove hass from init, part 1 * use async_added_to_hass instead of dispatcher_connect * remove hass from init, part 2 (done) * add 1-2 arrays, and tidied up some comments * from dispatcher to async_added_to_hass * cleaned up some logging, and removed others * Many changes as request by @MartinHjelmare * Homage to the lint * Changed to the HA of doing operating_mode * Now using update_before_add=True * reduced logging further still... * fixed minor lint * fix a small logic error * Add device_state_attributes to track actual operating mode * Clean up doc quotes caused by previous changes * Woops! removed some debug lines that shoudln't have stayed in * Add a complete set of device_state_attributes * Cleanup some constants * Remove more legacy code * domain_data to evo_data & this else should be a finally * minor change for readability * Minor change for readability #2 * removed unused code * small tidy up - no code changes * fix minor lint * Correct URLs & descriptions in docstring * whoops - fixed a typo in docstrings * remove an unused line of cide & a small tidy-up
2018-09-27 11:29:44 +00:00
"Check your username (%s), and password are correct."
"Unable to continue. Resolve any errors and restart HA.",
evo_data['params'][CONF_USERNAME]
)
Add zones to evohome component (#18428) * Added Zones, and removed available() logic flesh out Zones tidy up init some more tidying up Nearly there - full functionality passed txo - ready to send PR Ready to PR, except to remove logging Add Zones and associated functionality to evohome component Add Zones to evohome (some more tidying up) Add Zones to evohome (Nearly there - full functionality) Add Zones to evohome (passed tox) Add Zones to evohome (except to remove logging) Add Zones and associated functionality to evohome component Revert _LOGGER.warn to .debug, as it should be Cleanup stupid REBASE * removed a duplicate/unwanted code block * tidy up comment * use async_added_to_hass instead of bus.listen * Pass evo_data instead of hass when instntiating * switch to async version of setup_platform/add_entities * Remove workaround for bug in client library - using github version for now, as awaiting new PyPi package * Avoid invalid-name lint - use 'zone_idx' instead of 'z' * Fix line too long error * remove commented-out line of code * fix a logic error, improve REDACTION of potentially-sensitive infomation * restore use of EVENT_HOMEASSISTANT_START to improve HA startup time * added a docstring to _flatten_json * Switch instantiation from component to platform * Use v0.2.8 of client api (resolves logging bug) * import rather than duplicate, and de-lint * We use evohomeclient v0.2.8 now * remove all the api logging * Changed scan_interal to Throttle * added a configurable scan_interval * small code tidy-up, removed sub-function * tidy up update() code * minimize use of self.hass.data[] * remove lint * remove unwanted logging * remove debug code * correct a small coding error * small tidyup of code * remove flatten_json * add @callback to _first_update() * switch back to load_platform * adhere to standards fro logging * use new format string formatting * minor change to comments * convert scan_interval to timedelta from int * restore rounding up of scan_interval * code tidy up * sync when in sync context * fix typo * remove raises not needed * tidy up typos, etc. * remove invalid-name lint * tidy up exception handling * de-lint/pretty-fy * move 'status' to a JSON node, so theirs room for 'config', 'schedule' in the future
2018-11-27 11:17:22 +00:00
elif err.response.status_code == HTTP_SERVICE_UNAVAILABLE:
_LOGGER.error(
"setup(): Failed to connect with the vendor's web servers. "
"The server is not contactable. Unable to continue. "
"Resolve any errors and restart HA."
)
elif err.response.status_code == HTTP_TOO_MANY_REQUESTS:
_LOGGER.error(
"setup(): Failed to connect with the vendor's web servers. "
"You have exceeded the api rate limit. Unable to continue. "
"Wait a while (say 10 minutes) and restart HA."
)
else:
raise # we dont expect/handle any other HTTPErrors
Add (EU-based) Honeywell evohome CH/DHW controller (#16427) * Add support for Honeywell evohome CH/DHW systems More flake8 corrections Passes Flake8 tests Almost passed flake8.pylint! Passed all tox tests Now it needs serious testing! Almost ready to submit BUGFIX: DHW state now functional More improvements to available() Solved the DHW temp units problem! Last minute bug squash to improve dicts merge Trying to rebase fixing more rbase errors revert to creating HTTP_error_code internally for now ready to submit PR Added support for Honeywell evohome CH/DHW systems * Updated requirements_test_all.txt * Fix: D401 First line should be in imperative mood * Remove _LOGGER.info (replace with _LOGGER.debug) * raise PlatformNotReady when RequestException during setup() * Revert some LOGGER.debug to LOGGER.warning * Improved logging levels, and removed some unwanted comments * Improvments to logging - additional self._status info * BUGFIX: DHW wrongly showing available = False (and some other tweaks) * Fix trailing whitespace * Remove state_attributes override and API_VER code * Removed heating zones, DHW and heuristics to reduce # lines of code * Removed some more lines of code * Removed unused configuration parameters * Remove some more un-needed lines * Removed more (uneeded) lines of code & fixed two minor typos * Improvements to debug logging of available() = False * Improvements to code, and code clean-up * Corrected a minor typo * A small tidy up * reduces precision of emulated temps floats to 0.1 * Some code improvements as suggested by JeardM * Rewrite of exception handler * Removed another unwanted logging in properties * Remove async_ version of various methods * moved available heuristics to update() * Cleanup of code, and re-work linter hints * fixed a minor documentation typo * scan_interval is now no longer a configurable option * Change from Master/Slave to Parent/Child * Removed the last of the slaves * Removed the last of the masters * Move -PARALLEL_UPDATES to .\climate\evohome.py' * main code moved to climate/evohome.py * merge EvoEntity into EvoController class * remove should_poll (for now) * woops! left a hint in * removed icon * only log a WARNING the first time available = False * cleanup dodgy exception handling * Tidy up exception handling * Many changes as suggested by @MartinHjelmare, thanks * remove hass from init, part 1 * use async_added_to_hass instead of dispatcher_connect * remove hass from init, part 2 (done) * add 1-2 arrays, and tidied up some comments * from dispatcher to async_added_to_hass * cleaned up some logging, and removed others * Many changes as request by @MartinHjelmare * Homage to the lint * Changed to the HA of doing operating_mode * Now using update_before_add=True * reduced logging further still... * fixed minor lint * fix a small logic error * Add device_state_attributes to track actual operating mode * Clean up doc quotes caused by previous changes * Woops! removed some debug lines that shoudln't have stayed in * Add a complete set of device_state_attributes * Cleanup some constants * Remove more legacy code * domain_data to evo_data & this else should be a finally * minor change for readability * Minor change for readability #2 * removed unused code * small tidy up - no code changes * fix minor lint * Correct URLs & descriptions in docstring * whoops - fixed a typo in docstrings * remove an unused line of cide & a small tidy-up
2018-09-27 11:29:44 +00:00
Add zones to evohome component (#18428) * Added Zones, and removed available() logic flesh out Zones tidy up init some more tidying up Nearly there - full functionality passed txo - ready to send PR Ready to PR, except to remove logging Add Zones and associated functionality to evohome component Add Zones to evohome (some more tidying up) Add Zones to evohome (Nearly there - full functionality) Add Zones to evohome (passed tox) Add Zones to evohome (except to remove logging) Add Zones and associated functionality to evohome component Revert _LOGGER.warn to .debug, as it should be Cleanup stupid REBASE * removed a duplicate/unwanted code block * tidy up comment * use async_added_to_hass instead of bus.listen * Pass evo_data instead of hass when instntiating * switch to async version of setup_platform/add_entities * Remove workaround for bug in client library - using github version for now, as awaiting new PyPi package * Avoid invalid-name lint - use 'zone_idx' instead of 'z' * Fix line too long error * remove commented-out line of code * fix a logic error, improve REDACTION of potentially-sensitive infomation * restore use of EVENT_HOMEASSISTANT_START to improve HA startup time * added a docstring to _flatten_json * Switch instantiation from component to platform * Use v0.2.8 of client api (resolves logging bug) * import rather than duplicate, and de-lint * We use evohomeclient v0.2.8 now * remove all the api logging * Changed scan_interal to Throttle * added a configurable scan_interval * small code tidy-up, removed sub-function * tidy up update() code * minimize use of self.hass.data[] * remove lint * remove unwanted logging * remove debug code * correct a small coding error * small tidyup of code * remove flatten_json * add @callback to _first_update() * switch back to load_platform * adhere to standards fro logging * use new format string formatting * minor change to comments * convert scan_interval to timedelta from int * restore rounding up of scan_interval * code tidy up * sync when in sync context * fix typo * remove raises not needed * tidy up typos, etc. * remove invalid-name lint * tidy up exception handling * de-lint/pretty-fy * move 'status' to a JSON node, so theirs room for 'config', 'schedule' in the future
2018-11-27 11:17:22 +00:00
return False # unable to continue
finally: # Redact username, password as no longer needed
Add (EU-based) Honeywell evohome CH/DHW controller (#16427) * Add support for Honeywell evohome CH/DHW systems More flake8 corrections Passes Flake8 tests Almost passed flake8.pylint! Passed all tox tests Now it needs serious testing! Almost ready to submit BUGFIX: DHW state now functional More improvements to available() Solved the DHW temp units problem! Last minute bug squash to improve dicts merge Trying to rebase fixing more rbase errors revert to creating HTTP_error_code internally for now ready to submit PR Added support for Honeywell evohome CH/DHW systems * Updated requirements_test_all.txt * Fix: D401 First line should be in imperative mood * Remove _LOGGER.info (replace with _LOGGER.debug) * raise PlatformNotReady when RequestException during setup() * Revert some LOGGER.debug to LOGGER.warning * Improved logging levels, and removed some unwanted comments * Improvments to logging - additional self._status info * BUGFIX: DHW wrongly showing available = False (and some other tweaks) * Fix trailing whitespace * Remove state_attributes override and API_VER code * Removed heating zones, DHW and heuristics to reduce # lines of code * Removed some more lines of code * Removed unused configuration parameters * Remove some more un-needed lines * Removed more (uneeded) lines of code & fixed two minor typos * Improvements to debug logging of available() = False * Improvements to code, and code clean-up * Corrected a minor typo * A small tidy up * reduces precision of emulated temps floats to 0.1 * Some code improvements as suggested by JeardM * Rewrite of exception handler * Removed another unwanted logging in properties * Remove async_ version of various methods * moved available heuristics to update() * Cleanup of code, and re-work linter hints * fixed a minor documentation typo * scan_interval is now no longer a configurable option * Change from Master/Slave to Parent/Child * Removed the last of the slaves * Removed the last of the masters * Move -PARALLEL_UPDATES to .\climate\evohome.py' * main code moved to climate/evohome.py * merge EvoEntity into EvoController class * remove should_poll (for now) * woops! left a hint in * removed icon * only log a WARNING the first time available = False * cleanup dodgy exception handling * Tidy up exception handling * Many changes as suggested by @MartinHjelmare, thanks * remove hass from init, part 1 * use async_added_to_hass instead of dispatcher_connect * remove hass from init, part 2 (done) * add 1-2 arrays, and tidied up some comments * from dispatcher to async_added_to_hass * cleaned up some logging, and removed others * Many changes as request by @MartinHjelmare * Homage to the lint * Changed to the HA of doing operating_mode * Now using update_before_add=True * reduced logging further still... * fixed minor lint * fix a small logic error * Add device_state_attributes to track actual operating mode * Clean up doc quotes caused by previous changes * Woops! removed some debug lines that shoudln't have stayed in * Add a complete set of device_state_attributes * Cleanup some constants * Remove more legacy code * domain_data to evo_data & this else should be a finally * minor change for readability * Minor change for readability #2 * removed unused code * small tidy up - no code changes * fix minor lint * Correct URLs & descriptions in docstring * whoops - fixed a typo in docstrings * remove an unused line of cide & a small tidy-up
2018-09-27 11:29:44 +00:00
evo_data['params'][CONF_USERNAME] = 'REDACTED'
evo_data['params'][CONF_PASSWORD] = 'REDACTED'
evo_data['client'] = client
Add zones to evohome component (#18428) * Added Zones, and removed available() logic flesh out Zones tidy up init some more tidying up Nearly there - full functionality passed txo - ready to send PR Ready to PR, except to remove logging Add Zones and associated functionality to evohome component Add Zones to evohome (some more tidying up) Add Zones to evohome (Nearly there - full functionality) Add Zones to evohome (passed tox) Add Zones to evohome (except to remove logging) Add Zones and associated functionality to evohome component Revert _LOGGER.warn to .debug, as it should be Cleanup stupid REBASE * removed a duplicate/unwanted code block * tidy up comment * use async_added_to_hass instead of bus.listen * Pass evo_data instead of hass when instntiating * switch to async version of setup_platform/add_entities * Remove workaround for bug in client library - using github version for now, as awaiting new PyPi package * Avoid invalid-name lint - use 'zone_idx' instead of 'z' * Fix line too long error * remove commented-out line of code * fix a logic error, improve REDACTION of potentially-sensitive infomation * restore use of EVENT_HOMEASSISTANT_START to improve HA startup time * added a docstring to _flatten_json * Switch instantiation from component to platform * Use v0.2.8 of client api (resolves logging bug) * import rather than duplicate, and de-lint * We use evohomeclient v0.2.8 now * remove all the api logging * Changed scan_interal to Throttle * added a configurable scan_interval * small code tidy-up, removed sub-function * tidy up update() code * minimize use of self.hass.data[] * remove lint * remove unwanted logging * remove debug code * correct a small coding error * small tidyup of code * remove flatten_json * add @callback to _first_update() * switch back to load_platform * adhere to standards fro logging * use new format string formatting * minor change to comments * convert scan_interval to timedelta from int * restore rounding up of scan_interval * code tidy up * sync when in sync context * fix typo * remove raises not needed * tidy up typos, etc. * remove invalid-name lint * tidy up exception handling * de-lint/pretty-fy * move 'status' to a JSON node, so theirs room for 'config', 'schedule' in the future
2018-11-27 11:17:22 +00:00
evo_data['status'] = {}
Add (EU-based) Honeywell evohome CH/DHW controller (#16427) * Add support for Honeywell evohome CH/DHW systems More flake8 corrections Passes Flake8 tests Almost passed flake8.pylint! Passed all tox tests Now it needs serious testing! Almost ready to submit BUGFIX: DHW state now functional More improvements to available() Solved the DHW temp units problem! Last minute bug squash to improve dicts merge Trying to rebase fixing more rbase errors revert to creating HTTP_error_code internally for now ready to submit PR Added support for Honeywell evohome CH/DHW systems * Updated requirements_test_all.txt * Fix: D401 First line should be in imperative mood * Remove _LOGGER.info (replace with _LOGGER.debug) * raise PlatformNotReady when RequestException during setup() * Revert some LOGGER.debug to LOGGER.warning * Improved logging levels, and removed some unwanted comments * Improvments to logging - additional self._status info * BUGFIX: DHW wrongly showing available = False (and some other tweaks) * Fix trailing whitespace * Remove state_attributes override and API_VER code * Removed heating zones, DHW and heuristics to reduce # lines of code * Removed some more lines of code * Removed unused configuration parameters * Remove some more un-needed lines * Removed more (uneeded) lines of code & fixed two minor typos * Improvements to debug logging of available() = False * Improvements to code, and code clean-up * Corrected a minor typo * A small tidy up * reduces precision of emulated temps floats to 0.1 * Some code improvements as suggested by JeardM * Rewrite of exception handler * Removed another unwanted logging in properties * Remove async_ version of various methods * moved available heuristics to update() * Cleanup of code, and re-work linter hints * fixed a minor documentation typo * scan_interval is now no longer a configurable option * Change from Master/Slave to Parent/Child * Removed the last of the slaves * Removed the last of the masters * Move -PARALLEL_UPDATES to .\climate\evohome.py' * main code moved to climate/evohome.py * merge EvoEntity into EvoController class * remove should_poll (for now) * woops! left a hint in * removed icon * only log a WARNING the first time available = False * cleanup dodgy exception handling * Tidy up exception handling * Many changes as suggested by @MartinHjelmare, thanks * remove hass from init, part 1 * use async_added_to_hass instead of dispatcher_connect * remove hass from init, part 2 (done) * add 1-2 arrays, and tidied up some comments * from dispatcher to async_added_to_hass * cleaned up some logging, and removed others * Many changes as request by @MartinHjelmare * Homage to the lint * Changed to the HA of doing operating_mode * Now using update_before_add=True * reduced logging further still... * fixed minor lint * fix a small logic error * Add device_state_attributes to track actual operating mode * Clean up doc quotes caused by previous changes * Woops! removed some debug lines that shoudln't have stayed in * Add a complete set of device_state_attributes * Cleanup some constants * Remove more legacy code * domain_data to evo_data & this else should be a finally * minor change for readability * Minor change for readability #2 * removed unused code * small tidy up - no code changes * fix minor lint * Correct URLs & descriptions in docstring * whoops - fixed a typo in docstrings * remove an unused line of cide & a small tidy-up
2018-09-27 11:29:44 +00:00
Add zones to evohome component (#18428) * Added Zones, and removed available() logic flesh out Zones tidy up init some more tidying up Nearly there - full functionality passed txo - ready to send PR Ready to PR, except to remove logging Add Zones and associated functionality to evohome component Add Zones to evohome (some more tidying up) Add Zones to evohome (Nearly there - full functionality) Add Zones to evohome (passed tox) Add Zones to evohome (except to remove logging) Add Zones and associated functionality to evohome component Revert _LOGGER.warn to .debug, as it should be Cleanup stupid REBASE * removed a duplicate/unwanted code block * tidy up comment * use async_added_to_hass instead of bus.listen * Pass evo_data instead of hass when instntiating * switch to async version of setup_platform/add_entities * Remove workaround for bug in client library - using github version for now, as awaiting new PyPi package * Avoid invalid-name lint - use 'zone_idx' instead of 'z' * Fix line too long error * remove commented-out line of code * fix a logic error, improve REDACTION of potentially-sensitive infomation * restore use of EVENT_HOMEASSISTANT_START to improve HA startup time * added a docstring to _flatten_json * Switch instantiation from component to platform * Use v0.2.8 of client api (resolves logging bug) * import rather than duplicate, and de-lint * We use evohomeclient v0.2.8 now * remove all the api logging * Changed scan_interal to Throttle * added a configurable scan_interval * small code tidy-up, removed sub-function * tidy up update() code * minimize use of self.hass.data[] * remove lint * remove unwanted logging * remove debug code * correct a small coding error * small tidyup of code * remove flatten_json * add @callback to _first_update() * switch back to load_platform * adhere to standards fro logging * use new format string formatting * minor change to comments * convert scan_interval to timedelta from int * restore rounding up of scan_interval * code tidy up * sync when in sync context * fix typo * remove raises not needed * tidy up typos, etc. * remove invalid-name lint * tidy up exception handling * de-lint/pretty-fy * move 'status' to a JSON node, so theirs room for 'config', 'schedule' in the future
2018-11-27 11:17:22 +00:00
# Redact any installation data we'll never need
for loc in client.installation_info:
loc['locationInfo']['locationId'] = 'REDACTED'
loc['locationInfo']['locationOwner'] = 'REDACTED'
loc['locationInfo']['streetAddress'] = 'REDACTED'
loc['locationInfo']['city'] = 'REDACTED'
loc[GWS][0]['gatewayInfo'] = 'REDACTED'
Add (EU-based) Honeywell evohome CH/DHW controller (#16427) * Add support for Honeywell evohome CH/DHW systems More flake8 corrections Passes Flake8 tests Almost passed flake8.pylint! Passed all tox tests Now it needs serious testing! Almost ready to submit BUGFIX: DHW state now functional More improvements to available() Solved the DHW temp units problem! Last minute bug squash to improve dicts merge Trying to rebase fixing more rbase errors revert to creating HTTP_error_code internally for now ready to submit PR Added support for Honeywell evohome CH/DHW systems * Updated requirements_test_all.txt * Fix: D401 First line should be in imperative mood * Remove _LOGGER.info (replace with _LOGGER.debug) * raise PlatformNotReady when RequestException during setup() * Revert some LOGGER.debug to LOGGER.warning * Improved logging levels, and removed some unwanted comments * Improvments to logging - additional self._status info * BUGFIX: DHW wrongly showing available = False (and some other tweaks) * Fix trailing whitespace * Remove state_attributes override and API_VER code * Removed heating zones, DHW and heuristics to reduce # lines of code * Removed some more lines of code * Removed unused configuration parameters * Remove some more un-needed lines * Removed more (uneeded) lines of code & fixed two minor typos * Improvements to debug logging of available() = False * Improvements to code, and code clean-up * Corrected a minor typo * A small tidy up * reduces precision of emulated temps floats to 0.1 * Some code improvements as suggested by JeardM * Rewrite of exception handler * Removed another unwanted logging in properties * Remove async_ version of various methods * moved available heuristics to update() * Cleanup of code, and re-work linter hints * fixed a minor documentation typo * scan_interval is now no longer a configurable option * Change from Master/Slave to Parent/Child * Removed the last of the slaves * Removed the last of the masters * Move -PARALLEL_UPDATES to .\climate\evohome.py' * main code moved to climate/evohome.py * merge EvoEntity into EvoController class * remove should_poll (for now) * woops! left a hint in * removed icon * only log a WARNING the first time available = False * cleanup dodgy exception handling * Tidy up exception handling * Many changes as suggested by @MartinHjelmare, thanks * remove hass from init, part 1 * use async_added_to_hass instead of dispatcher_connect * remove hass from init, part 2 (done) * add 1-2 arrays, and tidied up some comments * from dispatcher to async_added_to_hass * cleaned up some logging, and removed others * Many changes as request by @MartinHjelmare * Homage to the lint * Changed to the HA of doing operating_mode * Now using update_before_add=True * reduced logging further still... * fixed minor lint * fix a small logic error * Add device_state_attributes to track actual operating mode * Clean up doc quotes caused by previous changes * Woops! removed some debug lines that shoudln't have stayed in * Add a complete set of device_state_attributes * Cleanup some constants * Remove more legacy code * domain_data to evo_data & this else should be a finally * minor change for readability * Minor change for readability #2 * removed unused code * small tidy up - no code changes * fix minor lint * Correct URLs & descriptions in docstring * whoops - fixed a typo in docstrings * remove an unused line of cide & a small tidy-up
2018-09-27 11:29:44 +00:00
Add zones to evohome component (#18428) * Added Zones, and removed available() logic flesh out Zones tidy up init some more tidying up Nearly there - full functionality passed txo - ready to send PR Ready to PR, except to remove logging Add Zones and associated functionality to evohome component Add Zones to evohome (some more tidying up) Add Zones to evohome (Nearly there - full functionality) Add Zones to evohome (passed tox) Add Zones to evohome (except to remove logging) Add Zones and associated functionality to evohome component Revert _LOGGER.warn to .debug, as it should be Cleanup stupid REBASE * removed a duplicate/unwanted code block * tidy up comment * use async_added_to_hass instead of bus.listen * Pass evo_data instead of hass when instntiating * switch to async version of setup_platform/add_entities * Remove workaround for bug in client library - using github version for now, as awaiting new PyPi package * Avoid invalid-name lint - use 'zone_idx' instead of 'z' * Fix line too long error * remove commented-out line of code * fix a logic error, improve REDACTION of potentially-sensitive infomation * restore use of EVENT_HOMEASSISTANT_START to improve HA startup time * added a docstring to _flatten_json * Switch instantiation from component to platform * Use v0.2.8 of client api (resolves logging bug) * import rather than duplicate, and de-lint * We use evohomeclient v0.2.8 now * remove all the api logging * Changed scan_interal to Throttle * added a configurable scan_interval * small code tidy-up, removed sub-function * tidy up update() code * minimize use of self.hass.data[] * remove lint * remove unwanted logging * remove debug code * correct a small coding error * small tidyup of code * remove flatten_json * add @callback to _first_update() * switch back to load_platform * adhere to standards fro logging * use new format string formatting * minor change to comments * convert scan_interval to timedelta from int * restore rounding up of scan_interval * code tidy up * sync when in sync context * fix typo * remove raises not needed * tidy up typos, etc. * remove invalid-name lint * tidy up exception handling * de-lint/pretty-fy * move 'status' to a JSON node, so theirs room for 'config', 'schedule' in the future
2018-11-27 11:17:22 +00:00
# Pull down the installation configuration
Add (EU-based) Honeywell evohome CH/DHW controller (#16427) * Add support for Honeywell evohome CH/DHW systems More flake8 corrections Passes Flake8 tests Almost passed flake8.pylint! Passed all tox tests Now it needs serious testing! Almost ready to submit BUGFIX: DHW state now functional More improvements to available() Solved the DHW temp units problem! Last minute bug squash to improve dicts merge Trying to rebase fixing more rbase errors revert to creating HTTP_error_code internally for now ready to submit PR Added support for Honeywell evohome CH/DHW systems * Updated requirements_test_all.txt * Fix: D401 First line should be in imperative mood * Remove _LOGGER.info (replace with _LOGGER.debug) * raise PlatformNotReady when RequestException during setup() * Revert some LOGGER.debug to LOGGER.warning * Improved logging levels, and removed some unwanted comments * Improvments to logging - additional self._status info * BUGFIX: DHW wrongly showing available = False (and some other tweaks) * Fix trailing whitespace * Remove state_attributes override and API_VER code * Removed heating zones, DHW and heuristics to reduce # lines of code * Removed some more lines of code * Removed unused configuration parameters * Remove some more un-needed lines * Removed more (uneeded) lines of code & fixed two minor typos * Improvements to debug logging of available() = False * Improvements to code, and code clean-up * Corrected a minor typo * A small tidy up * reduces precision of emulated temps floats to 0.1 * Some code improvements as suggested by JeardM * Rewrite of exception handler * Removed another unwanted logging in properties * Remove async_ version of various methods * moved available heuristics to update() * Cleanup of code, and re-work linter hints * fixed a minor documentation typo * scan_interval is now no longer a configurable option * Change from Master/Slave to Parent/Child * Removed the last of the slaves * Removed the last of the masters * Move -PARALLEL_UPDATES to .\climate\evohome.py' * main code moved to climate/evohome.py * merge EvoEntity into EvoController class * remove should_poll (for now) * woops! left a hint in * removed icon * only log a WARNING the first time available = False * cleanup dodgy exception handling * Tidy up exception handling * Many changes as suggested by @MartinHjelmare, thanks * remove hass from init, part 1 * use async_added_to_hass instead of dispatcher_connect * remove hass from init, part 2 (done) * add 1-2 arrays, and tidied up some comments * from dispatcher to async_added_to_hass * cleaned up some logging, and removed others * Many changes as request by @MartinHjelmare * Homage to the lint * Changed to the HA of doing operating_mode * Now using update_before_add=True * reduced logging further still... * fixed minor lint * fix a small logic error * Add device_state_attributes to track actual operating mode * Clean up doc quotes caused by previous changes * Woops! removed some debug lines that shoudln't have stayed in * Add a complete set of device_state_attributes * Cleanup some constants * Remove more legacy code * domain_data to evo_data & this else should be a finally * minor change for readability * Minor change for readability #2 * removed unused code * small tidy up - no code changes * fix minor lint * Correct URLs & descriptions in docstring * whoops - fixed a typo in docstrings * remove an unused line of cide & a small tidy-up
2018-09-27 11:29:44 +00:00
loc_idx = evo_data['params'][CONF_LOCATION_IDX]
try:
evo_data['config'] = client.installation_info[loc_idx]
except IndexError:
_LOGGER.warning(
Add zones to evohome component (#18428) * Added Zones, and removed available() logic flesh out Zones tidy up init some more tidying up Nearly there - full functionality passed txo - ready to send PR Ready to PR, except to remove logging Add Zones and associated functionality to evohome component Add Zones to evohome (some more tidying up) Add Zones to evohome (Nearly there - full functionality) Add Zones to evohome (passed tox) Add Zones to evohome (except to remove logging) Add Zones and associated functionality to evohome component Revert _LOGGER.warn to .debug, as it should be Cleanup stupid REBASE * removed a duplicate/unwanted code block * tidy up comment * use async_added_to_hass instead of bus.listen * Pass evo_data instead of hass when instntiating * switch to async version of setup_platform/add_entities * Remove workaround for bug in client library - using github version for now, as awaiting new PyPi package * Avoid invalid-name lint - use 'zone_idx' instead of 'z' * Fix line too long error * remove commented-out line of code * fix a logic error, improve REDACTION of potentially-sensitive infomation * restore use of EVENT_HOMEASSISTANT_START to improve HA startup time * added a docstring to _flatten_json * Switch instantiation from component to platform * Use v0.2.8 of client api (resolves logging bug) * import rather than duplicate, and de-lint * We use evohomeclient v0.2.8 now * remove all the api logging * Changed scan_interal to Throttle * added a configurable scan_interval * small code tidy-up, removed sub-function * tidy up update() code * minimize use of self.hass.data[] * remove lint * remove unwanted logging * remove debug code * correct a small coding error * small tidyup of code * remove flatten_json * add @callback to _first_update() * switch back to load_platform * adhere to standards fro logging * use new format string formatting * minor change to comments * convert scan_interval to timedelta from int * restore rounding up of scan_interval * code tidy up * sync when in sync context * fix typo * remove raises not needed * tidy up typos, etc. * remove invalid-name lint * tidy up exception handling * de-lint/pretty-fy * move 'status' to a JSON node, so theirs room for 'config', 'schedule' in the future
2018-11-27 11:17:22 +00:00
"setup(): Parameter '%s'=%s, is outside its range (0-%s)",
Add (EU-based) Honeywell evohome CH/DHW controller (#16427) * Add support for Honeywell evohome CH/DHW systems More flake8 corrections Passes Flake8 tests Almost passed flake8.pylint! Passed all tox tests Now it needs serious testing! Almost ready to submit BUGFIX: DHW state now functional More improvements to available() Solved the DHW temp units problem! Last minute bug squash to improve dicts merge Trying to rebase fixing more rbase errors revert to creating HTTP_error_code internally for now ready to submit PR Added support for Honeywell evohome CH/DHW systems * Updated requirements_test_all.txt * Fix: D401 First line should be in imperative mood * Remove _LOGGER.info (replace with _LOGGER.debug) * raise PlatformNotReady when RequestException during setup() * Revert some LOGGER.debug to LOGGER.warning * Improved logging levels, and removed some unwanted comments * Improvments to logging - additional self._status info * BUGFIX: DHW wrongly showing available = False (and some other tweaks) * Fix trailing whitespace * Remove state_attributes override and API_VER code * Removed heating zones, DHW and heuristics to reduce # lines of code * Removed some more lines of code * Removed unused configuration parameters * Remove some more un-needed lines * Removed more (uneeded) lines of code & fixed two minor typos * Improvements to debug logging of available() = False * Improvements to code, and code clean-up * Corrected a minor typo * A small tidy up * reduces precision of emulated temps floats to 0.1 * Some code improvements as suggested by JeardM * Rewrite of exception handler * Removed another unwanted logging in properties * Remove async_ version of various methods * moved available heuristics to update() * Cleanup of code, and re-work linter hints * fixed a minor documentation typo * scan_interval is now no longer a configurable option * Change from Master/Slave to Parent/Child * Removed the last of the slaves * Removed the last of the masters * Move -PARALLEL_UPDATES to .\climate\evohome.py' * main code moved to climate/evohome.py * merge EvoEntity into EvoController class * remove should_poll (for now) * woops! left a hint in * removed icon * only log a WARNING the first time available = False * cleanup dodgy exception handling * Tidy up exception handling * Many changes as suggested by @MartinHjelmare, thanks * remove hass from init, part 1 * use async_added_to_hass instead of dispatcher_connect * remove hass from init, part 2 (done) * add 1-2 arrays, and tidied up some comments * from dispatcher to async_added_to_hass * cleaned up some logging, and removed others * Many changes as request by @MartinHjelmare * Homage to the lint * Changed to the HA of doing operating_mode * Now using update_before_add=True * reduced logging further still... * fixed minor lint * fix a small logic error * Add device_state_attributes to track actual operating mode * Clean up doc quotes caused by previous changes * Woops! removed some debug lines that shoudln't have stayed in * Add a complete set of device_state_attributes * Cleanup some constants * Remove more legacy code * domain_data to evo_data & this else should be a finally * minor change for readability * Minor change for readability #2 * removed unused code * small tidy up - no code changes * fix minor lint * Correct URLs & descriptions in docstring * whoops - fixed a typo in docstrings * remove an unused line of cide & a small tidy-up
2018-09-27 11:29:44 +00:00
CONF_LOCATION_IDX,
loc_idx,
len(client.installation_info) - 1
)
return False # unable to continue
if _LOGGER.isEnabledFor(logging.DEBUG):
tmp_loc = dict(evo_data['config'])
tmp_loc['locationInfo']['postcode'] = 'REDACTED'
Add zones to evohome component (#18428) * Added Zones, and removed available() logic flesh out Zones tidy up init some more tidying up Nearly there - full functionality passed txo - ready to send PR Ready to PR, except to remove logging Add Zones and associated functionality to evohome component Add Zones to evohome (some more tidying up) Add Zones to evohome (Nearly there - full functionality) Add Zones to evohome (passed tox) Add Zones to evohome (except to remove logging) Add Zones and associated functionality to evohome component Revert _LOGGER.warn to .debug, as it should be Cleanup stupid REBASE * removed a duplicate/unwanted code block * tidy up comment * use async_added_to_hass instead of bus.listen * Pass evo_data instead of hass when instntiating * switch to async version of setup_platform/add_entities * Remove workaround for bug in client library - using github version for now, as awaiting new PyPi package * Avoid invalid-name lint - use 'zone_idx' instead of 'z' * Fix line too long error * remove commented-out line of code * fix a logic error, improve REDACTION of potentially-sensitive infomation * restore use of EVENT_HOMEASSISTANT_START to improve HA startup time * added a docstring to _flatten_json * Switch instantiation from component to platform * Use v0.2.8 of client api (resolves logging bug) * import rather than duplicate, and de-lint * We use evohomeclient v0.2.8 now * remove all the api logging * Changed scan_interal to Throttle * added a configurable scan_interval * small code tidy-up, removed sub-function * tidy up update() code * minimize use of self.hass.data[] * remove lint * remove unwanted logging * remove debug code * correct a small coding error * small tidyup of code * remove flatten_json * add @callback to _first_update() * switch back to load_platform * adhere to standards fro logging * use new format string formatting * minor change to comments * convert scan_interval to timedelta from int * restore rounding up of scan_interval * code tidy up * sync when in sync context * fix typo * remove raises not needed * tidy up typos, etc. * remove invalid-name lint * tidy up exception handling * de-lint/pretty-fy * move 'status' to a JSON node, so theirs room for 'config', 'schedule' in the future
2018-11-27 11:17:22 +00:00
if 'dhw' in tmp_loc[GWS][0][TCS][0]: # if this location has DHW...
tmp_loc[GWS][0][TCS][0]['dhw'] = '...'
_LOGGER.debug("setup(): evo_data['config']=%s", tmp_loc)
load_platform(hass, 'climate', DOMAIN, {}, hass_config)
Add (EU-based) Honeywell evohome CH/DHW controller (#16427) * Add support for Honeywell evohome CH/DHW systems More flake8 corrections Passes Flake8 tests Almost passed flake8.pylint! Passed all tox tests Now it needs serious testing! Almost ready to submit BUGFIX: DHW state now functional More improvements to available() Solved the DHW temp units problem! Last minute bug squash to improve dicts merge Trying to rebase fixing more rbase errors revert to creating HTTP_error_code internally for now ready to submit PR Added support for Honeywell evohome CH/DHW systems * Updated requirements_test_all.txt * Fix: D401 First line should be in imperative mood * Remove _LOGGER.info (replace with _LOGGER.debug) * raise PlatformNotReady when RequestException during setup() * Revert some LOGGER.debug to LOGGER.warning * Improved logging levels, and removed some unwanted comments * Improvments to logging - additional self._status info * BUGFIX: DHW wrongly showing available = False (and some other tweaks) * Fix trailing whitespace * Remove state_attributes override and API_VER code * Removed heating zones, DHW and heuristics to reduce # lines of code * Removed some more lines of code * Removed unused configuration parameters * Remove some more un-needed lines * Removed more (uneeded) lines of code & fixed two minor typos * Improvements to debug logging of available() = False * Improvements to code, and code clean-up * Corrected a minor typo * A small tidy up * reduces precision of emulated temps floats to 0.1 * Some code improvements as suggested by JeardM * Rewrite of exception handler * Removed another unwanted logging in properties * Remove async_ version of various methods * moved available heuristics to update() * Cleanup of code, and re-work linter hints * fixed a minor documentation typo * scan_interval is now no longer a configurable option * Change from Master/Slave to Parent/Child * Removed the last of the slaves * Removed the last of the masters * Move -PARALLEL_UPDATES to .\climate\evohome.py' * main code moved to climate/evohome.py * merge EvoEntity into EvoController class * remove should_poll (for now) * woops! left a hint in * removed icon * only log a WARNING the first time available = False * cleanup dodgy exception handling * Tidy up exception handling * Many changes as suggested by @MartinHjelmare, thanks * remove hass from init, part 1 * use async_added_to_hass instead of dispatcher_connect * remove hass from init, part 2 (done) * add 1-2 arrays, and tidied up some comments * from dispatcher to async_added_to_hass * cleaned up some logging, and removed others * Many changes as request by @MartinHjelmare * Homage to the lint * Changed to the HA of doing operating_mode * Now using update_before_add=True * reduced logging further still... * fixed minor lint * fix a small logic error * Add device_state_attributes to track actual operating mode * Clean up doc quotes caused by previous changes * Woops! removed some debug lines that shoudln't have stayed in * Add a complete set of device_state_attributes * Cleanup some constants * Remove more legacy code * domain_data to evo_data & this else should be a finally * minor change for readability * Minor change for readability #2 * removed unused code * small tidy up - no code changes * fix minor lint * Correct URLs & descriptions in docstring * whoops - fixed a typo in docstrings * remove an unused line of cide & a small tidy-up
2018-09-27 11:29:44 +00:00
Add zones to evohome component (#18428) * Added Zones, and removed available() logic flesh out Zones tidy up init some more tidying up Nearly there - full functionality passed txo - ready to send PR Ready to PR, except to remove logging Add Zones and associated functionality to evohome component Add Zones to evohome (some more tidying up) Add Zones to evohome (Nearly there - full functionality) Add Zones to evohome (passed tox) Add Zones to evohome (except to remove logging) Add Zones and associated functionality to evohome component Revert _LOGGER.warn to .debug, as it should be Cleanup stupid REBASE * removed a duplicate/unwanted code block * tidy up comment * use async_added_to_hass instead of bus.listen * Pass evo_data instead of hass when instntiating * switch to async version of setup_platform/add_entities * Remove workaround for bug in client library - using github version for now, as awaiting new PyPi package * Avoid invalid-name lint - use 'zone_idx' instead of 'z' * Fix line too long error * remove commented-out line of code * fix a logic error, improve REDACTION of potentially-sensitive infomation * restore use of EVENT_HOMEASSISTANT_START to improve HA startup time * added a docstring to _flatten_json * Switch instantiation from component to platform * Use v0.2.8 of client api (resolves logging bug) * import rather than duplicate, and de-lint * We use evohomeclient v0.2.8 now * remove all the api logging * Changed scan_interal to Throttle * added a configurable scan_interval * small code tidy-up, removed sub-function * tidy up update() code * minimize use of self.hass.data[] * remove lint * remove unwanted logging * remove debug code * correct a small coding error * small tidyup of code * remove flatten_json * add @callback to _first_update() * switch back to load_platform * adhere to standards fro logging * use new format string formatting * minor change to comments * convert scan_interval to timedelta from int * restore rounding up of scan_interval * code tidy up * sync when in sync context * fix typo * remove raises not needed * tidy up typos, etc. * remove invalid-name lint * tidy up exception handling * de-lint/pretty-fy * move 'status' to a JSON node, so theirs room for 'config', 'schedule' in the future
2018-11-27 11:17:22 +00:00
@callback
def _first_update(event):
# When HA has started, the hub knows to retreive it's first update
pkt = {'sender': 'setup()', 'signal': 'refresh', 'to': EVO_PARENT}
async_dispatcher_send(hass, DISPATCHER_EVOHOME, pkt)
Add (EU-based) Honeywell evohome CH/DHW controller (#16427) * Add support for Honeywell evohome CH/DHW systems More flake8 corrections Passes Flake8 tests Almost passed flake8.pylint! Passed all tox tests Now it needs serious testing! Almost ready to submit BUGFIX: DHW state now functional More improvements to available() Solved the DHW temp units problem! Last minute bug squash to improve dicts merge Trying to rebase fixing more rbase errors revert to creating HTTP_error_code internally for now ready to submit PR Added support for Honeywell evohome CH/DHW systems * Updated requirements_test_all.txt * Fix: D401 First line should be in imperative mood * Remove _LOGGER.info (replace with _LOGGER.debug) * raise PlatformNotReady when RequestException during setup() * Revert some LOGGER.debug to LOGGER.warning * Improved logging levels, and removed some unwanted comments * Improvments to logging - additional self._status info * BUGFIX: DHW wrongly showing available = False (and some other tweaks) * Fix trailing whitespace * Remove state_attributes override and API_VER code * Removed heating zones, DHW and heuristics to reduce # lines of code * Removed some more lines of code * Removed unused configuration parameters * Remove some more un-needed lines * Removed more (uneeded) lines of code & fixed two minor typos * Improvements to debug logging of available() = False * Improvements to code, and code clean-up * Corrected a minor typo * A small tidy up * reduces precision of emulated temps floats to 0.1 * Some code improvements as suggested by JeardM * Rewrite of exception handler * Removed another unwanted logging in properties * Remove async_ version of various methods * moved available heuristics to update() * Cleanup of code, and re-work linter hints * fixed a minor documentation typo * scan_interval is now no longer a configurable option * Change from Master/Slave to Parent/Child * Removed the last of the slaves * Removed the last of the masters * Move -PARALLEL_UPDATES to .\climate\evohome.py' * main code moved to climate/evohome.py * merge EvoEntity into EvoController class * remove should_poll (for now) * woops! left a hint in * removed icon * only log a WARNING the first time available = False * cleanup dodgy exception handling * Tidy up exception handling * Many changes as suggested by @MartinHjelmare, thanks * remove hass from init, part 1 * use async_added_to_hass instead of dispatcher_connect * remove hass from init, part 2 (done) * add 1-2 arrays, and tidied up some comments * from dispatcher to async_added_to_hass * cleaned up some logging, and removed others * Many changes as request by @MartinHjelmare * Homage to the lint * Changed to the HA of doing operating_mode * Now using update_before_add=True * reduced logging further still... * fixed minor lint * fix a small logic error * Add device_state_attributes to track actual operating mode * Clean up doc quotes caused by previous changes * Woops! removed some debug lines that shoudln't have stayed in * Add a complete set of device_state_attributes * Cleanup some constants * Remove more legacy code * domain_data to evo_data & this else should be a finally * minor change for readability * Minor change for readability #2 * removed unused code * small tidy up - no code changes * fix minor lint * Correct URLs & descriptions in docstring * whoops - fixed a typo in docstrings * remove an unused line of cide & a small tidy-up
2018-09-27 11:29:44 +00:00
Add zones to evohome component (#18428) * Added Zones, and removed available() logic flesh out Zones tidy up init some more tidying up Nearly there - full functionality passed txo - ready to send PR Ready to PR, except to remove logging Add Zones and associated functionality to evohome component Add Zones to evohome (some more tidying up) Add Zones to evohome (Nearly there - full functionality) Add Zones to evohome (passed tox) Add Zones to evohome (except to remove logging) Add Zones and associated functionality to evohome component Revert _LOGGER.warn to .debug, as it should be Cleanup stupid REBASE * removed a duplicate/unwanted code block * tidy up comment * use async_added_to_hass instead of bus.listen * Pass evo_data instead of hass when instntiating * switch to async version of setup_platform/add_entities * Remove workaround for bug in client library - using github version for now, as awaiting new PyPi package * Avoid invalid-name lint - use 'zone_idx' instead of 'z' * Fix line too long error * remove commented-out line of code * fix a logic error, improve REDACTION of potentially-sensitive infomation * restore use of EVENT_HOMEASSISTANT_START to improve HA startup time * added a docstring to _flatten_json * Switch instantiation from component to platform * Use v0.2.8 of client api (resolves logging bug) * import rather than duplicate, and de-lint * We use evohomeclient v0.2.8 now * remove all the api logging * Changed scan_interal to Throttle * added a configurable scan_interval * small code tidy-up, removed sub-function * tidy up update() code * minimize use of self.hass.data[] * remove lint * remove unwanted logging * remove debug code * correct a small coding error * small tidyup of code * remove flatten_json * add @callback to _first_update() * switch back to load_platform * adhere to standards fro logging * use new format string formatting * minor change to comments * convert scan_interval to timedelta from int * restore rounding up of scan_interval * code tidy up * sync when in sync context * fix typo * remove raises not needed * tidy up typos, etc. * remove invalid-name lint * tidy up exception handling * de-lint/pretty-fy * move 'status' to a JSON node, so theirs room for 'config', 'schedule' in the future
2018-11-27 11:17:22 +00:00
hass.bus.listen(EVENT_HOMEASSISTANT_START, _first_update)
Add (EU-based) Honeywell evohome CH/DHW controller (#16427) * Add support for Honeywell evohome CH/DHW systems More flake8 corrections Passes Flake8 tests Almost passed flake8.pylint! Passed all tox tests Now it needs serious testing! Almost ready to submit BUGFIX: DHW state now functional More improvements to available() Solved the DHW temp units problem! Last minute bug squash to improve dicts merge Trying to rebase fixing more rbase errors revert to creating HTTP_error_code internally for now ready to submit PR Added support for Honeywell evohome CH/DHW systems * Updated requirements_test_all.txt * Fix: D401 First line should be in imperative mood * Remove _LOGGER.info (replace with _LOGGER.debug) * raise PlatformNotReady when RequestException during setup() * Revert some LOGGER.debug to LOGGER.warning * Improved logging levels, and removed some unwanted comments * Improvments to logging - additional self._status info * BUGFIX: DHW wrongly showing available = False (and some other tweaks) * Fix trailing whitespace * Remove state_attributes override and API_VER code * Removed heating zones, DHW and heuristics to reduce # lines of code * Removed some more lines of code * Removed unused configuration parameters * Remove some more un-needed lines * Removed more (uneeded) lines of code & fixed two minor typos * Improvements to debug logging of available() = False * Improvements to code, and code clean-up * Corrected a minor typo * A small tidy up * reduces precision of emulated temps floats to 0.1 * Some code improvements as suggested by JeardM * Rewrite of exception handler * Removed another unwanted logging in properties * Remove async_ version of various methods * moved available heuristics to update() * Cleanup of code, and re-work linter hints * fixed a minor documentation typo * scan_interval is now no longer a configurable option * Change from Master/Slave to Parent/Child * Removed the last of the slaves * Removed the last of the masters * Move -PARALLEL_UPDATES to .\climate\evohome.py' * main code moved to climate/evohome.py * merge EvoEntity into EvoController class * remove should_poll (for now) * woops! left a hint in * removed icon * only log a WARNING the first time available = False * cleanup dodgy exception handling * Tidy up exception handling * Many changes as suggested by @MartinHjelmare, thanks * remove hass from init, part 1 * use async_added_to_hass instead of dispatcher_connect * remove hass from init, part 2 (done) * add 1-2 arrays, and tidied up some comments * from dispatcher to async_added_to_hass * cleaned up some logging, and removed others * Many changes as request by @MartinHjelmare * Homage to the lint * Changed to the HA of doing operating_mode * Now using update_before_add=True * reduced logging further still... * fixed minor lint * fix a small logic error * Add device_state_attributes to track actual operating mode * Clean up doc quotes caused by previous changes * Woops! removed some debug lines that shoudln't have stayed in * Add a complete set of device_state_attributes * Cleanup some constants * Remove more legacy code * domain_data to evo_data & this else should be a finally * minor change for readability * Minor change for readability #2 * removed unused code * small tidy up - no code changes * fix minor lint * Correct URLs & descriptions in docstring * whoops - fixed a typo in docstrings * remove an unused line of cide & a small tidy-up
2018-09-27 11:29:44 +00:00
return True