We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9e08690 commit b496d33Copy full SHA for b496d33
1 file changed
custom_components/google_nest_fan/__init__.py
@@ -84,7 +84,10 @@ async def _async_run_fan(call: ServiceCall) -> None:
84
for device in devices:
85
trait: FanTrait = device.traits[FanTrait.NAME]
86
try:
87
- await trait.set_timer("ON", duration=round(duration.total_seconds()))
+ if duration.total_seconds() > 0:
88
+ await trait.set_timer("ON", duration=round(duration.total_seconds()))
89
+ else:
90
+ await trait.set_timer("OFF")
91
except ApiException as err:
92
raise ServiceValidationError(
93
f"Error setting fan run time for {device.name} {duration.total_seconds()}s: {err}"
0 commit comments