diff --git a/custom_components/bhyve/services.yaml b/custom_components/bhyve/services.yaml index 6181cf3..41e3f1d 100644 --- a/custom_components/bhyve/services.yaml +++ b/custom_components/bhyve/services.yaml @@ -1,5 +1,3 @@ -# Describes the format for available virtual services - enable_rain_delay: description: Enable rain delay for a zone fields: diff --git a/custom_components/bhyve/strings.json b/custom_components/bhyve/strings.json index b45fe13..828bc13 100644 --- a/custom_components/bhyve/strings.json +++ b/custom_components/bhyve/strings.json @@ -46,5 +46,93 @@ "cannot_connect": "[%key:common::config_flow::error::cannot_connect%]", "unknown": "[%key:common::config_flow::error::unknown%]" } + }, + "services": { + "enable_rain_delay": { + "name": "Enable rain delay", + "description": "Enable rain delay for a zone", + "fields": { + "entity_id": { + "name": "Zone switch", + "description": "The switch to enable rain delay for" + }, + "hours": { + "name": "Hours", + "description": "The number of hours to enable rain delay for" + } + } + }, + "disable_rain_delay": { + "name": "Disable rain delay", + "description": "Disable rain delay for a zone", + "fields": { + "entity_id": { + "name": "Zone switch", + "description": "The switch to disable rain delay for" + } + } + }, + "start_watering": { + "name": "Start watering", + "description": "Start watering a zone", + "fields": { + "entity_id": { + "name": "Zone switch", + "description": "The switch to start watering" + }, + "minutes": { + "name": "Minutes", + "description": "The number of minutes to water for" + } + } + }, + "stop_watering": { + "name": "Stop watering", + "description": "Stop watering a zone", + "fields": { + "entity_id": { + "name": "Zone switch", + "description": "The switch to stop watering" + } + } + }, + "set_manual_preset_runtime": { + "name": "Set manual preset runtime", + "description": "Set the manual preset runtime for a device entity", + "fields": { + "entity_id": { + "name": "Zone switch", + "description": "The switch to set the manual preset runtime for" + }, + "minutes": { + "name": "Minutes", + "description": "The number of minutes to set the manual preset runtime to" + } + } + }, + "set_smart_watering_soil_moisture": { + "name": "Set smart watering soil moisture", + "description": "Set the smart watering soil moisture level for a zone", + "fields": { + "entity_id": { + "name": "Zone switch", + "description": "The switch to set the smart watering soil moisture for" + }, + "percentage": { + "name": "Percentage", + "description": "Moisture level between 0 - 100 (percent)" + } + } + }, + "start_program": { + "name": "Start program", + "description": "Begin watering a program", + "fields": { + "entity_id": { + "name": "Program switch", + "description": "The program to start" + } + } + } } } diff --git a/custom_components/bhyve/translations/en.json b/custom_components/bhyve/translations/en.json index f8928b5..0cc98ab 100644 --- a/custom_components/bhyve/translations/en.json +++ b/custom_components/bhyve/translations/en.json @@ -46,5 +46,93 @@ "title": "Select Devices" } } + }, + "services": { + "enable_rain_delay": { + "name": "Enable rain delay", + "description": "Enable rain delay for a zone", + "fields": { + "entity_id": { + "name": "Zone switch", + "description": "The switch to enable rain delay for" + }, + "hours": { + "name": "Hours", + "description": "The number of hours to enable rain delay for" + } + } + }, + "disable_rain_delay": { + "name": "Disable rain delay", + "description": "Disable rain delay for a zone", + "fields": { + "entity_id": { + "name": "Zone switch", + "description": "The switch to disable rain delay for" + } + } + }, + "start_watering": { + "name": "Start watering", + "description": "Start watering a zone", + "fields": { + "entity_id": { + "name": "Zone switch", + "description": "The switch to start watering" + }, + "minutes": { + "name": "Minutes", + "description": "The number of minutes to water for" + } + } + }, + "stop_watering": { + "name": "Stop watering", + "description": "Stop watering a zone", + "fields": { + "entity_id": { + "name": "Zone switch", + "description": "The switch to stop watering" + } + } + }, + "set_manual_preset_runtime": { + "name": "Set manual preset runtime", + "description": "Set the manual preset runtime for a device entity", + "fields": { + "entity_id": { + "name": "Zone switch", + "description": "The switch to set the manual preset runtime for" + }, + "minutes": { + "name": "Minutes", + "description": "The number of minutes to set the manual preset runtime to" + } + } + }, + "set_smart_watering_soil_moisture": { + "name": "Set smart watering soil moisture", + "description": "Set the smart watering soil moisture level for a zone", + "fields": { + "entity_id": { + "name": "Zone switch", + "description": "The switch to set the smart watering soil moisture for" + }, + "percentage": { + "name": "Percentage", + "description": "Moisture level between 0 - 100 (percent)" + } + } + }, + "start_program": { + "name": "Start program", + "description": "Begin watering a program", + "fields": { + "entity_id": { + "name": "Program switch", + "description": "The program to start" + } + } + } } } diff --git a/debug/debug.py b/debug/debug.py index 48d0f7a..f912104 100755 --- a/debug/debug.py +++ b/debug/debug.py @@ -29,6 +29,7 @@ if device.get("type") == "sprinkler_timer": zones = device.get("zones") print(f"{'Sprinkler':>10}: {name}") + print(f"{'id':>10}: {device.get('id')}") print(f"{'Battery':>10}: {device.get('battery').get('percent')}%") print(f"{'Zones':>10}: {len(zones)}") for zone in device.get("zones"):