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

Move service names and descriptions to translations file #212

Merged
merged 1 commit into from
Jul 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions custom_components/bhyve/services.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Describes the format for available virtual services

enable_rain_delay:
description: Enable rain delay for a zone
fields:
Expand Down
88 changes: 88 additions & 0 deletions custom_components/bhyve/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
}
}
88 changes: 88 additions & 0 deletions custom_components/bhyve/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
}
}
1 change: 1 addition & 0 deletions debug/debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"):
Expand Down