From cdf98071e71410d98cb8b729b643617112adabc2 Mon Sep 17 00:00:00 2001 From: Phil Bruckner Date: Wed, 3 Apr 2024 14:22:03 -0500 Subject: [PATCH] Update services.yaml & en.json --- custom_components/sun2/services.yaml | 39 +++++++++++++++++++++ custom_components/sun2/translations/en.json | 33 +++++++++++++++++ 2 files changed, 72 insertions(+) diff --git a/custom_components/sun2/services.yaml b/custom_components/sun2/services.yaml index 50ece8f..530a04d 100644 --- a/custom_components/sun2/services.yaml +++ b/custom_components/sun2/services.yaml @@ -1 +1,40 @@ reload: {} + +get_location: + fields: + location: + required: true + example: Home + default: Home + selector: + text: + +update_location: + fields: + location: + required: true + example: Home + default: Home + selector: + text: + latitude: + required: false + example: 51.51 + selector: + number: + step: any + longitude: + required: false + example: -0.13 + selector: + number: + step: any + time_zone: + required: false + example: Europe/London + selector: + text: + observer_elevation: + required: false + selector: + object: diff --git a/custom_components/sun2/translations/en.json b/custom_components/sun2/translations/en.json index 18e7219..c7d193a 100644 --- a/custom_components/sun2/translations/en.json +++ b/custom_components/sun2/translations/en.json @@ -531,9 +531,42 @@ } }, "services": { + "get_location": { + "name": "Get location", + "description": "Get location options.", + "fields": { + "location": { + "name": "Location", + "description": "Name of integration entry." + } + } + }, "reload": { "name": "Reload", "description": "Reloads Sun2 from the YAML-configuration." + }, + "update_location": { + "name": "Update location", + "description": "Update location options. NOTE: If any of Latitude, Longitude & Time zone are specified, they must all be specified.", + "fields": { + "location": { + "name": "Location", + "description": "Name of Sun2 integration entry. YAML-based entries are not supported." + }, + "latitude": { + "name": "Latitude" + }, + "longitude": { + "name": "Longitude" + }, + "time_zone": { + "name": "Time zone" + }, + "observer_elevation": { + "name": "Observer elevation", + "description": "Elevation above ground level, or any two of above_ground, sunrise_obstruction & sunset_obstruction." + } + } } } } \ No newline at end of file