diff --git a/custom_components/linktap/services.yaml b/custom_components/linktap/services.yaml index ef40464..64d13fa 100644 --- a/custom_components/linktap/services.yaml +++ b/custom_components/linktap/services.yaml @@ -42,13 +42,13 @@ pause_valve: domain: valve start_watering: - name: Start Watering + name: Start Watering for X seconds description: Turn on a valve for a set time fields: - minutes: - name: Minutes - example: 1439 - description: Duration in minutes + seconds: + name: Seconds + example: 900 + description: Duration in seconds target: entity: integration: linktap diff --git a/custom_components/linktap/valve.py b/custom_components/linktap/valve.py index d2800e3..0e31a45 100644 --- a/custom_components/linktap/valve.py +++ b/custom_components/linktap/valve.py @@ -152,10 +152,10 @@ async def _pause_tap(self, hours=False): await self.coordinator.tap_api.pause_tap(gw_id, self.tap_id, hours) await self.coordinator.async_request_refresh() - async def _start_watering(self, minutes=False): - if not minutes or minutes == 0: - minutes = 1439 - _LOGGER.debug(f"Starting watering via service call for {minutes} minutes") + async def _start_watering(self, seconds=False): + if not seconds or seconds == 0: + seconds = 1439 * 60 + _LOGGER.debug(f"Starting watering via service call for {seconds} seconds") gw_id = self.coordinator.get_gw_id() - await self.coordinator.tap_api.turn_on(gw_id, self.tap_id, minutes) + await self.coordinator.tap_api.turn_on(gw_id, self.tap_id, seconds) await self.coordinator.async_request_refresh()