We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug When calling weather-forecast-cache, the system reports an insufficient number of parameters.
2024-12-30 20:17:33,838 - web_server - INFO - >> Obtaining params: 2024-12-30 20:17:33,840 - web_server - INFO - Passed runtime parameters: {} 2024-12-30 20:17:33,840 - web_server - INFO - >> Performing weather forecast, try to caching result 2024-12-30 20:17:33,841 - web_server - ERROR - Exception on /action/weather-forecast-cache [POST] Traceback (most recent call last): File "/usr/local/lib/python3.11/dist-packages/flask/app.py", line 1511, in wsgi_app response = self.full_dispatch_request() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/flask/app.py", line 919, in full_dispatch_request rv = self.handle_user_exception(e) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/flask/app.py", line 917, in full_dispatch_request rv = self.dispatch_request() ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/flask/app.py", line 902, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/emhass/web_server.py", line 380, in action_call weather_forecast_cache(emhass_conf, params, runtimeparams, app.logger) File "/usr/local/lib/python3.11/dist-packages/emhass/command_line.py", line 440, in weather_forecast_cache params, retrieve_hass_conf, optim_conf, plant_conf = utils.treat_runtimeparams( ^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: treat_runtimeparams() takes 8 positional arguments but 9 were given
In old sourcecode 0.11.4 was:
def weather_forecast_cache( emhass_conf: dict, params: str, runtimeparams: str, logger: logging.Logger ) -> bool: # Parsing yaml retrieve_hass_conf, optim_conf, plant_conf = utils.get_yaml_parse(params, logger) # Treat runtimeparams params, retrieve_hass_conf, optim_conf, plant_conf = utils.treat_runtimeparams( runtimeparams, params, retrieve_hass_conf, optim_conf, plant_conf, "forecast", logger, emhass_conf, )
In 0.12.1:
def weather_forecast_cache( emhass_conf: dict, params: str, runtimeparams: str, logger: logging.Logger ) -> bool: # Parsing yaml retrieve_hass_conf, optim_conf, plant_conf = utils.get_yaml_parse(params, logger) # Treat runtimeparams params, retrieve_hass_conf, optim_conf, plant_conf = utils.treat_runtimeparams( runtimeparams, params, retrieve_hass_conf, optim_conf, plant_conf, "forecast", logger, emhass_conf, {}, )
To Reproduce weather forecast is called from automation, where a shell script is called (in configuration.yaml):
shell_command: weather_cache: "curl -i -H \"Content-Type:application/json\" -X POST -d '{}' http://localhost:5000/action/weather-forecast-cache"
Expected behavior No errors.
Screenshots If applicable, add screenshots to help explain your problem.
Home Assistant installation type
Your hardware
EMHASS installation type
The text was updated successfully, but these errors were encountered:
Fix Problem with calling weather-forecast-cache
3d26b00
Solves #412
Thanks for reporting this. Solved in #415
Sorry, something went wrong.
No branches or pull requests
Describe the bug
When calling weather-forecast-cache, the system reports an insufficient number of parameters.
2024-12-30 20:17:33,838 - web_server - INFO - >> Obtaining params:
2024-12-30 20:17:33,840 - web_server - INFO - Passed runtime parameters: {}
2024-12-30 20:17:33,840 - web_server - INFO - >> Performing weather forecast, try to caching result
2024-12-30 20:17:33,841 - web_server - ERROR - Exception on /action/weather-forecast-cache [POST]
Traceback (most recent call last):
File "/usr/local/lib/python3.11/dist-packages/flask/app.py", line 1511, in wsgi_app
response = self.full_dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/flask/app.py", line 919, in full_dispatch_request
rv = self.handle_user_exception(e)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/flask/app.py", line 917, in full_dispatch_request
rv = self.dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/flask/app.py", line 902, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/emhass/web_server.py", line 380, in action_call
weather_forecast_cache(emhass_conf, params, runtimeparams, app.logger)
File "/usr/local/lib/python3.11/dist-packages/emhass/command_line.py", line 440, in weather_forecast_cache
params, retrieve_hass_conf, optim_conf, plant_conf = utils.treat_runtimeparams(
^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: treat_runtimeparams() takes 8 positional arguments but 9 were given
In old sourcecode 0.11.4 was:
In 0.12.1:
To Reproduce
weather forecast is called from automation, where a shell script is called (in configuration.yaml):
Expected behavior
No errors.
Screenshots
If applicable, add screenshots to help explain your problem.
Home Assistant installation type
Your hardware
EMHASS installation type
The text was updated successfully, but these errors were encountered: