Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

await check_ambient_air_temperature #567

Merged
merged 1 commit into from
Nov 10, 2022
Merged

await check_ambient_air_temperature #567

merged 1 commit into from
Nov 10, 2022

Conversation

virtualm2000
Copy link
Contributor

Motivation:

Beta35 didn't register state change events because of this:

2022-11-08 15:41:08.487 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/config/custom_components/better_thermostat/climate.py", line 632, in startup
    await self._trigger_check_weather(None)
  File "/config/custom_components/better_thermostat/climate.py", line 329, in _trigger_check_weather
    check_weather(self)
  File "/config/custom_components/better_thermostat/utils/weather.py", line 35, in check_weather
    self.call_for_heat = self._last_avg_outdoor_temp < self.off_temperature
TypeError: '<' not supported between instances of 'NoneType' and 'float'

This is happening because the check_ambient_air_temperature is not done yet to set the self._last_avg_outdoor_temp

The exception would terminate self.startup_running loop and loose the chance of setting the listener.

Changes:

Actually await for the task check_ambient_air_temperature to finish

Related issue (check one):

Checklist (check one):

  • I did not change any code (e.g. documentation changes)
  • The code change is tested and works locally.

Test-Hardware list (for code changes)

HA Version:
Zigbee2MQTT Version:
TRV Hardware:

New device mappings

  • I avoided any changes to other device mappings
  • There are no changes in climate.py

@KartoffelToby KartoffelToby merged commit b2691ff into KartoffelToby:master Nov 10, 2022
@KartoffelToby
Copy link
Owner

@virtualm2000 thanks <3

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

Successfully merging this pull request may close these issues.

1.0.0-beta35 temperature from room sensor is not updating
2 participants