Skip to content

Rework tado component#29246

Merged
michaelarnauts merged 16 commits into
home-assistant:devfrom
michaelarnauts:tado-rework
Dec 20, 2019
Merged

Rework tado component#29246
michaelarnauts merged 16 commits into
home-assistant:devfrom
michaelarnauts:tado-rework

Conversation

@michaelarnauts
Copy link
Copy Markdown
Contributor

@michaelarnauts michaelarnauts commented Nov 30, 2019

Description:

This PR reworks the Tado component:

  • Use the dispatcher and should_poll=False on the entities. This fixes some timing issues where we had to wait an additional polling period for the entities to get valid data.
  • Removed functions that were not implemented and we don't need according to our SUPPORT_FLAGS
  • Code cleanup
  • Don't force to refresh all zones when one zone is changed.
  • Fix turning on the climate when we don't have a temperature.
  • Remove obsolete convert_temperature's.
  • Add fallback (bool) setting to indicate if tado has to fallback to a schedule or not.
  • Log real error on 422 HTTP errors.

Documentation change: home-assistant/home-assistant.io#11497

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly. Update and include derived files by running python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt by running python3 -m script.gen_requirements_all.
  • Untested files have been added to .coveragerc.

@MartinHjelmare
Copy link
Copy Markdown
Member

Please split this PR into at least two PRs, one for the refactor and one to add the water_heater platform.

@michaelarnauts
Copy link
Copy Markdown
Contributor Author

@MartinHjelmare

Okay, I will do this.

@michaelarnauts
Copy link
Copy Markdown
Contributor Author

michaelarnauts commented Dec 4, 2019

I'll put the water_heater back in a new PR.

@michaelarnauts
Copy link
Copy Markdown
Contributor Author

@ejaviga could you take a look if your air conditioning is still working fine with these changes?

@michaelarnauts michaelarnauts changed the title WIP: Rework tado component Rework tado component Dec 5, 2019
@michaelarnauts
Copy link
Copy Markdown
Contributor Author

@MartinHjelmare is this okay for you? (I'm highlighting you since you've looked at this requests in the past).

When this gets merged, I can open the new PR for the water_heater.

@MartinHjelmare
Copy link
Copy Markdown
Member

Sorry, I'm busy this week. I'll try to find some time.

Comment thread homeassistant/components/tado/climate.py Outdated
@michaelarnauts
Copy link
Copy Markdown
Contributor Author

I've modified the data flow like @balloob asked. Now, the component registers for the sensor updates, and stores them. It still uses the dispatcher to notify the platforms.

The platform will fetch the stored data the first time, and uses the dispatcher to be notified of updates.

Comment thread homeassistant/components/tado/__init__.py Outdated
Comment thread homeassistant/components/tado/__init__.py Outdated
Comment thread homeassistant/components/tado/climate.py Outdated
Comment thread homeassistant/components/tado/climate.py Outdated
Comment thread homeassistant/components/tado/climate.py Outdated
Comment thread homeassistant/components/tado/climate.py Outdated
Comment thread homeassistant/components/tado/sensor.py Outdated
Comment thread homeassistant/components/tado/climate.py Outdated
Comment thread homeassistant/components/tado/climate.py Outdated
Comment thread homeassistant/components/tado/climate.py Outdated
Comment thread homeassistant/components/tado/climate.py Outdated
Comment thread homeassistant/components/tado/climate.py Outdated
Comment thread homeassistant/components/tado/sensor.py Outdated
Comment thread homeassistant/components/tado/climate.py Outdated
Comment thread homeassistant/components/tado/climate.py Outdated
Comment thread homeassistant/components/tado/climate.py Outdated
Comment thread homeassistant/components/tado/__init__.py
Comment thread homeassistant/components/tado/__init__.py Outdated
Copy link
Copy Markdown
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! 🎉

@michaelarnauts michaelarnauts merged commit 04b5d6c into home-assistant:dev Dec 20, 2019
@michaelarnauts michaelarnauts deleted the tado-rework branch December 20, 2019 12:49
@michaelarnauts michaelarnauts mentioned this pull request Dec 20, 2019
9 tasks
@lock lock Bot locked and limited conversation to collaborators Dec 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants