dontinelli / fyta-custom_component

Home Assistant integration for FYTA plant sensors, configured as custom component
GNU General Public License v3.0
11 stars 1 forks source link

Componente crashes after installation #12

Closed resterampeberlin closed 7 months ago

resterampeberlin commented 7 months ago

System Health details

System Information

version core-2024.1.5
installation_type Home Assistant Container
dev false
hassio false
docker true
user root
virtualenv false
python_version 3.11.6
os_name Linux
os_version 6.1.0-rpi7-rpi-v8
arch aarch64
timezone Europe/Berlin
config_dir /config
Home Assistant Cloud logged_in | false -- | -- can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Dashboards dashboards | 1 -- | -- resources | 0 mode | auto-gen
Recorder oldest_recorder_run | 4. März 2024 um 19:07 -- | -- current_recorder_run | 11. März 2024 um 19:27 estimated_db_size | 10.54 MiB database_engine | sqlite database_version | 3.41.2

Checklist

Describe the issue

After installing the integration I get an error in the integration. The log shows: 2024-03-11 19:39:02.569 ERROR (MainThread) [homeassistant.configentries] Error setting up entry [hidden for privacy]_ for fyta Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 406, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/fyta/init.py", line 41, in async_setup_entry expiration: datetime | None = (datetime.fromisoformat(entry.data.get("expiration")).astimezone(ZoneInfo(tz)) if "expiration" in entry.data else None) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: fromisoformat: argument must be str

Reproduction steps

1. 2. 3. ...

Debug logs

See above

Diagnostics dump

No response

dontinelli commented 7 months ago

Thank you @resterampeberlin for your comprehensive description of the issue. Do you have access to the config entry (config/.storage/core.config_entries) and could you paste the config entry of "expiration"?

resterampeberlin commented 7 months ago

It reads "expiration": "2024-05-10T19:39:02.567950"

dontinelli commented 7 months ago

Does the error persist, if you restart HA? Just to be sure if it is only in the initialization after the installation or on every call of init.py.

resterampeberlin commented 7 months ago

Thanks for the hint. I restarted HA and now it works.

dontinelli commented 7 months ago

Good to hear. I will try to find out why the error occurs only in the first initialization.

dontinelli commented 7 months ago

Hi, it seems like I have the same problem, but restarting Home Assistant doesn't work for me. I currently only have one Fyta Beam. If I delete it in the (Android-) app, the integration starts. But as soon as I reconfigure the Beam in the app, it crashes again.

(HA Core-Version 2024.3.1)

In the latest version this issue has been resolved. I assume your issue is not related to this one, as this one was independent of having a Beam or not. Please consult the logs and - if appropriate - open a separate issue also posting your logs.