Running Home Assistant with pyTibber==0.30.1 gives me an error:
2024-08-27 12:53:36.477 ERROR (MainThread) [tibber.home] Error in rt_subscribe
Traceback (most recent call last):
File "/home/vscode/.local/ha-venv/lib/python3.12/site-packages/tibber/home.py", line 460, in _start
data = _add_extra_data(data)
^^^^^^^^^^^^^^^^^^^^^
File "/home/vscode/.local/ha-venv/lib/python3.12/site-packages/tibber/home.py", line 421, in _add_extra_data
if live_data.get("powerProduction", 0) > 0 and live_data.get("power") is None:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: '>' not supported between instances of 'NoneType' and 'int'
This happens because the powerProduction key in the extra data dict is None. Then the .get(..., 0) won't default to 0 because it's explicitly set to None and not missing.
This is the input I'm getting from the subscription.
Ref conversation in https://github.com/home-assistant/core/pull/124595
Running Home Assistant with
pyTibber==0.30.1
gives me an error:This happens because the
powerProduction
key in the extra data dict isNone
. Then the.get(..., 0)
won't default to 0 because it's explicitly set to None and not missing.This is the input I'm getting from the subscription.
We just need to explicitly check for None before comparing with 0.