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

Unable to load calendar #3

Closed
dkNeumann opened this issue Dec 29, 2022 · 17 comments
Closed

Unable to load calendar #3

dkNeumann opened this issue Dec 29, 2022 · 17 comments

Comments

@dkNeumann
Copy link

Hello,
Recently the integration stopped working, I get the following the system log:

Logger: homeassistant.components.sensor
Source: custom_components/flagdays_dk/sensor.py:70
Integration: Sensor (documentation, issues)
First occurred: 16.24.09 (2 occurrences)
Last logged: 16.24.09

Error adding entities for domain sensor with platform flagdays_dk
Error while setting up flagdays_dk platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 428, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 692, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 789, in add_to_platform_finish
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 545, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 583, in _async_write_ha_state
state = self._stringify_state(available)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 551, in _stringify_state
if (state := self.state) is None:
File "/config/custom_components/flagdays_dk/sensor.py", line 70, in state
return self._nextFlagDay.getDays()
AttributeError: 'NoneType' object has no attribute 'getDays'

I'm on:
Home Assistant 2022.12.8
Supervisor 2022.12.1
Operating System 9.4
Brugerfladeversion: 20221213.1 - latest

I have tried to remove the integration and the re-install with the default settings, but no luck.

@J-Lindvig
Copy link
Owner

Could be an issue occuring when the official list is empty....
https://www.justitsministeriet.dk/temaer/flagning/flagdage/

I will looking into the matter when possible.

@dkNeumann
Copy link
Author

Seems very possible, tried to look at justitsministeriet.dk and they have not updated the list, however it exists and can be reached specifying the year, as follows:
https://www.justitsministeriet.dk/temaer/flagning/flagdage/flagdage-2023/
Regards,
Henrik

@J-Lindvig
Copy link
Owner

Thank you for the contribution - I am a little preoccupied these days. Will update the integration "next year".... ;-)

@dkNeumann
Copy link
Author

dkNeumann commented Dec 29, 2022

I can confirm, that if I change the URL in the const.py file it works.
Happy New Year to you :-)

@J-Lindvig
Copy link
Owner

Wow, thank you for your effort....

@dkNeumann
Copy link
Author

I now have another problem loading the add-on:

My logs have this:
Logger: homeassistant.setup
Source: custom_components/flagdays_dk/init.py:39
Integration: flagdays_dk (documentation, issues)
First occurred: 18.26.06 (1 occurrences)
Last logged: 18.26.06

Error during setup of component flagdays_dk
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 253, in _async_setup_component
result = await task
File "/config/custom_components/flagdays_dk/init.py", line 39, in async_setup
flags = config[DOMAIN].get(CONF_FLAGS, [DEFAULT_FLAG])
AttributeError: 'NodeListClass' object has no attribute 'get'

@J-Lindvig
Copy link
Owner

J-Lindvig commented Jan 11, 2023 via email

@dkNeumann
Copy link
Author

Sound good.
Let me know where to get the code and I can test it on my install :-)

@J-Lindvig
Copy link
Owner

J-Lindvig commented Jan 12, 2023

A pre-release version is available here: https://my.ocloud.dk/index.php/s/pNDJyNZd9D5FKFY

flagdays_dk:
  # Optional entries
  offset: 5 # New name
  flagdays:
    - name: Jolly Roger Memorial Day
      flag: Jolly Roger
      date: 10-06-1975

    - name: Copenhagen Pride Month
      flag: Pride
      date: 01-08
      date_end: 31-08

    - name: Tim Berners Lee Birthday
      date: 08-06-1955
      priority: 2 # 0 is highest priority

    - name: Ada Lovelace Birthday
      date: 10-12-1815

@dkNeumann
Copy link
Author

I still get an error:

Logger: homeassistant.setup
Source: custom_components/flagdays_dk/init.py:28
Integration: flagdays_dk (documentation, issues)
First occurred: 17.01.24 (1 occurrences)
Last logged: 17.01.24

Error during setup of component flagdays_dk
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 253, in _async_setup_component
result = await task
File "/config/custom_components/flagdays_dk/init.py", line 28, in async_setup
flagdays.addCustom(config[DOMAIN].get(CONF_FLAGDAYS))
AttributeError: 'NodeListClass' object has no attribute 'get'

@J-Lindvig
Copy link
Owner

Try putting just flagdays: into the config.

It is a work in progress, but I believe that I will have a working version ready in a few days.

@J-Lindvig
Copy link
Owner

flagdays_dk:

@J-Lindvig
Copy link
Owner

Fixed in v.3.0.

@dkNeumann
Copy link
Author

Hi,
Still the same issue:

Logger: homeassistant.setup
Source: custom_components/flagdays_dk/init.py:63
Integration: flagdays_dk (documentation, issues)
First occurred: 16.12.06 (1 occurrences)
Last logged: 16.12.06

Error during setup of component flagdays_dk
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 253, in _async_setup_component
result = await task
File "/config/custom_components/flagdays_dk/init.py", line 63, in async_setup
for customFlagday in config[DOMAIN].get(CONF_FLAGDAYS):
TypeError: 'NoneType' object is not iterable

I'm running v3.0.1. Have the one line as config.

@J-Lindvig
Copy link
Owner

Oh, shit - I see it too with only the "one-liner"....

@J-Lindvig J-Lindvig reopened this Jan 16, 2023
@J-Lindvig
Copy link
Owner

I have fixed, but unable to upload to github at the moment.

@J-Lindvig
Copy link
Owner

Uploaded v3.0.2 with a fix.

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

No branches or pull requests

2 participants