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

Plant throws error on HA 2024.2.0b0 #136

Closed
hmmbob opened this issue Feb 1, 2024 · 5 comments · Fixed by #137
Closed

Plant throws error on HA 2024.2.0b0 #136

hmmbob opened this issue Feb 1, 2024 · 5 comments · Fixed by #137

Comments

@hmmbob
Copy link
Contributor

hmmbob commented Feb 1, 2024

Running latest beta of HA, and plant v2024.1.0:

2024-02-01 07:22:56.631 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up plant platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 326, in _async_setup_platform
await asyncio.shield(task)
File "/config/custom_components/plant/sensor.py", line 129, in async_setup_entry
pdli = PlantDailyLightIntegral(hass, entry, pintegral, plant)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/plant/sensor.py", line 579, in __init__
super().__init__(
TypeError: UtilityMeterSensor.__init__() missing 1 required keyword-only argument: 'sensor_always_available'
2024-02-01 07:22:56.648 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up plant platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 326, in _async_setup_platform
await asyncio.shield(task)
File "/config/custom_components/plant/sensor.py", line 129, in async_setup_entry
pdli = PlantDailyLightIntegral(hass, entry, pintegral, plant)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/plant/sensor.py", line 579, in __init__
super().__init__(
TypeError: UtilityMeterSensor.__init__() missing 1 required keyword-only argument: 'sensor_always_available'
2024-02-01 07:22:56.661 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up plant platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 326, in _async_setup_platform
await asyncio.shield(task)
File "/config/custom_components/plant/sensor.py", line 129, in async_setup_entry
pdli = PlantDailyLightIntegral(hass, entry, pintegral, plant)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/plant/sensor.py", line 579, in __init__
super().__init__(
TypeError: UtilityMeterSensor.__init__() missing 1 required keyword-only argument: 'sensor_always_available'
2024-02-01 07:22:56.672 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up plant platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 326, in _async_setup_platform
await asyncio.shield(task)
File "/config/custom_components/plant/sensor.py", line 129, in async_setup_entry
pdli = PlantDailyLightIntegral(hass, entry, pintegral, plant)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/plant/sensor.py", line 579, in __init__
super().__init__(
TypeError: UtilityMeterSensor.__init__() missing 1 required keyword-only argument: 'sensor_always_available'
2024-02-01 07:22:56.692 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up plant platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 326, in _async_setup_platform
await asyncio.shield(task)
File "/config/custom_components/plant/sensor.py", line 129, in async_setup_entry
pdli = PlantDailyLightIntegral(hass, entry, pintegral, plant)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/plant/sensor.py", line 579, in __init__
super().__init__(
TypeError: UtilityMeterSensor.__init__() missing 1 required keyword-only argument: 'sensor_always_available'

I think this might also cause the plant card to not render completely, but unsure (no errors in the Chrome console):

image

@Olen
Copy link
Owner

Olen commented Feb 1, 2024

Would you be able to test the PR i just created?

@hmmbob
Copy link
Contributor Author

hmmbob commented Feb 1, 2024

Sure, give me 5min for reboot etc

@hmmbob
Copy link
Contributor Author

hmmbob commented Feb 1, 2024

Yes, fixed.

However, in my impatience I opened the UI before the first data was in for 2 out of 5 plants - seems a typing issue may occur:

2024-02-01 10:52:18.890 WARNING (MainThread) [custom_components.plant] Sensor sensor.hangplant_air_humidity has device class 'humidity', state class 'measurement' unit '%' and suggested precision 'None' thus indicating it has a numeric value; however, it has the non-numeric value: 'unknown' (<class 'str'>)

@Olen
Copy link
Owner

Olen commented Feb 1, 2024

It's a known "problem".
This happens when it restores the value for some reason. I have tried about everything to get rid of the warnings, but they seem to be very persistant. Everythong should be fine as soon as it fetches a value from the source sensor.

@hmmbob
Copy link
Contributor Author

hmmbob commented Feb 1, 2024

Thanks for the quick fix!

@Olen Olen closed this as completed in #137 Feb 1, 2024
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 a pull request may close this issue.

2 participants