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

Error saving schedule with an Off slot #536

Closed
Chaoscontrol opened this issue Nov 28, 2024 · 4 comments
Closed

Error saving schedule with an Off slot #536

Chaoscontrol opened this issue Nov 28, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@Chaoscontrol
Copy link

When adjusting the schedules using the card, sometimes I get these errors when trying to save the edits, and they don't save. I try multiple times but it fails most of the time. Unsure if it saves at any point.

Logger: homeassistant.components.websocket_api.http.connection
Source: custom_components/wiser/websockets.py:423
integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 23:46:55 (1 occurrences)
Last logged: 23:46:55

[140394595316880] Error handling message: Unknown error (unknown_error) Axel from 2a05:87c6:139b:0:e938:47a6:2c26:c88f (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36)
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/aioWiserHeatAPI/schedule.py", line 217, in _convert_to_wiser_schedule
    schedule_day = self._convert_yaml_to_wiser_day(sched)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aioWiserHeatAPI/schedule.py", line 605, in _convert_yaml_to_wiser_day
    if tf._is_valid_temp(value):
       ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aioWiserHeatAPI/helpers/temp.py", line 72, in _is_valid_temp
    elif temp == TEMP_OFF or (temp >= TEMP_MINIMUM and temp <= TEMP_MAXIMUM):
                              ^^^^^^^^^^^^^^^^^^^^
TypeError: '>=' not supported between instances of 'str' and 'int'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/aioWiserHeatAPI/schedule.py", line 494, in set_schedule_from_ws_data
    schedule = self._convert_to_wiser_schedule(schedule_json)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aioWiserHeatAPI/schedule.py", line 235, in _convert_to_wiser_schedule
    raise WiserScheduleError(f"Error converting to Wiser schedule: {ex}")
aioWiserHeatAPI.exceptions.WiserScheduleError: Error converting to Wiser schedule: '>=' not supported between instances of 'str' and 'int'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 28, in _handle_async_response
    await func(hass, connection, msg)
  File "/config/custom_components/wiser/websockets.py", line 423, in websocket_save_schedule
    await schedule.set_schedule_from_ws_data(new_schedule)
  File "/usr/local/lib/python3.12/site-packages/aioWiserHeatAPI/schedule.py", line 502, in set_schedule_from_ws_data
    raise WiserScheduleError(
aioWiserHeatAPI.exceptions.WiserScheduleError: Error setting schedule from websocket data - Error converting to Wiser schedule: '>=' not supported between instances of 'str' and 'int'
@msp1974
Copy link
Collaborator

msp1974 commented Dec 2, 2024

What device/browser are you using for this? Not sure I recognise the signature.

Does it work on a PC/Android/iOS device?

@Chaoscontrol
Copy link
Author

Oh, it's Arc for Windows. I didn't try anywhere else as I didn't think it was browser related.

Just tried on Android app and it works. Any reason for this? Anything that can be done so it works on Arc?

@msp1974 msp1974 added the bug Something isn't working label Dec 3, 2024
@msp1974 msp1974 changed the title Error when editing schedules Error saving schedule with an Off slot Dec 3, 2024
@msp1974
Copy link
Collaborator

msp1974 commented Dec 3, 2024

I think the issue is when you have an Off setting in your schedule. I can recreate the error in that situation on any browser. Will look to implement a fix.

@msp1974 msp1974 mentioned this issue Dec 3, 2024
@msp1974
Copy link
Collaborator

msp1974 commented Dec 3, 2024

Fixed in v3.4.13. Please upgrade. Will close but reopen if you find other issues with the schedule saving.

@msp1974 msp1974 closed this as completed Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants