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

service: mypyllant.report : AttributeError: module 'custom_components.mypyllant.datetime' has no attribute 'now' #199

Open
1 task
heinemannj opened this issue Jul 30, 2024 · 0 comments

Comments

@heinemannj
Copy link

Before submitting a new issue

Problem description

service: mypyllant.report
data:
year: 2023

image

image

image

Logs

Logger: homeassistant.helpers.script.websocket_api_script
Source: helpers/script.py:527
First occurred: 12:56:50 (1 occurrences)
Last logged: 12:56:50

websocket_api script: Error executing script. Unexpected error for call_service at pos 1: module 'custom_components.mypyllant.datetime' has no attribute 'now'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 527, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 764, in _async_call_service_step
    response_data = await self._async_run_long_action(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 727, in _async_run_long_action
    return await long_task
           ^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2731, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2774, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/mypyllant/__init__.py", line 167, in handle_report
    year=int(call.data.get("year", datetime.now().year)),
                                   ^^^^^^^^^^^^
AttributeError: module 'custom_components.mypyllant.datetime' has no attribute 'now'
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