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

calendar no attribute 'get_events' #618

Open
phsdv opened this issue Jul 12, 2024 · 3 comments
Open

calendar no attribute 'get_events' #618

phsdv opened this issue Jul 12, 2024 · 3 comments

Comments

@phsdv
Copy link

phsdv commented Jul 12, 2024

As of HA core-2024.7 i get the following errors:

Exception in <file.verwarming.verwarming_woonkamer_calendar_based> line 39: events = calendar.woonkamer_thermostaat.get_events(return_response=True, blocking=True, duration='00:01') ^ AttributeError: 'StateVal' object has no attribute 'get_events'

code used on line 39:

events = calendar.woonkamer_thermostaat.get_events(return_response=True, blocking=True, duration='00:01')

There is a breaking change in 2024.7 however that is to replace list_events with get_events.
The coding was working before 2024.7

Running the get_events in the developer tools does work and can return data and does not give an error.

service: calendar.get_events
entity_id: calendar.woonkamer_thermostaat
data: {duration: '00:01'}

as I cannot reproduce this in the developer tool, I suspect that it must be in pyscript.

@phsdv phsdv closed this as completed Jul 22, 2024
@phsdv
Copy link
Author

phsdv commented Jul 22, 2024

update to core-2024.7.3 and now get_events works again. Apperently some change between 2024.7.0 and 2024.7.3 did fix this.

@phsdv
Copy link
Author

phsdv commented Aug 15, 2024

Update to 2024.8.1 and have this issue again:

Logger: custom_components.pyscript.file.verwarming.verwarming_woonkamer_calendar_based
Source: custom_components/pyscript/trigger.py:1382
integration: Pyscript Python scripting ([documentation](https://github.com/custom-components/pyscript), [issues](https://github.com/custom-components/pyscript/issues))
First occurred: August 13, 2024 at 14:23:13 (2754 occurrences)
Last logged: 12:16:13
Exception in <file.verwarming.verwarming_woonkamer_calendar_based> line 39: events = calendar.woonkamer_thermostaat.get_events(return_response=True, blocking=True, duration='00:01') ^ AttributeError: 'StateVal' object has no attribute 'get_events'

@phsdv phsdv reopened this Aug 15, 2024
@phsdv
Copy link
Author

phsdv commented Aug 18, 2024

Narrowed it down a bit. It appears that calendar.<entity_name>.get_events() is not working anymore:

events = calendar.woonkamer_thermostaat.get_events(duration='00:01')

While calendar.get_events(entity_id='<entity_name>', duration='00:01') is working

events = calendar.get_events(entity_id='calendar.woonkamer_thermostaat', duration='00:01')

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

1 participant