This PR addresses an error raised when attempting to toggle a zone switch. Specifically, when attempting to turn a zone switch on, the error message Failed to call service switch/turn_on. 'datetime.timedelta' object has no attribute 'minutes' is raised and the zone is not turned on.
Upon inspection, I found that the error is caused on line 625 of switch.py, in which the warning log call (to indicate manual preset runtime is 0) incorrectly attempts to use DEFAULT_MANUAL_RUNTIME.minutes. As minutes is not a valid attribute of a timedelta object (DEFAULT_MANUAL_RUNTIME), the error is raised. Resolved by changing this line to int(DEFAULT_MANUAL_RUNTIME.seconds / 60).
For reference, this occurred on the following set up/versions:
Home Assistant: 2022.12.9
bhyve-home-assistant: 3.0.1 (Installed via HACS)
Irrigation Controller: 57950 (HW: WT25-0001, FW: 0032)
This PR addresses an error raised when attempting to toggle a zone switch. Specifically, when attempting to turn a zone switch on, the error message
Failed to call service switch/turn_on. 'datetime.timedelta' object has no attribute 'minutes'
is raised and the zone is not turned on.Upon inspection, I found that the error is caused on line 625 of switch.py, in which the warning log call (to indicate manual preset runtime is 0) incorrectly attempts to use
DEFAULT_MANUAL_RUNTIME.minutes
. Asminutes
is not a valid attribute of a timedelta object (DEFAULT_MANUAL_RUNTIME
), the error is raised. Resolved by changing this line toint(DEFAULT_MANUAL_RUNTIME.seconds / 60)
.For reference, this occurred on the following set up/versions: Home Assistant: 2022.12.9 bhyve-home-assistant: 3.0.1 (Installed via HACS) Irrigation Controller: 57950 (HW: WT25-0001, FW: 0032)