Skip to content

Commit

Permalink
Rearrange and add details to config_flow
Browse files Browse the repository at this point in the history
  • Loading branch information
Snuffy2 committed Jan 9, 2025
1 parent 064414a commit d081bd1
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 20 deletions.
14 changes: 7 additions & 7 deletions custom_components/places/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,9 @@ async def async_step_user(
)
),
vol.Optional(CONF_LANGUAGE): str,
vol.Optional(CONF_USE_GPS, default=DEFAULT_USE_GPS): selector.BooleanSelector(
selector.BooleanSelectorConfig()
),
vol.Optional(
CONF_EXTENDED_ATTR, default=DEFAULT_EXTENDED_ATTR
): selector.BooleanSelector(selector.BooleanSelectorConfig()),
Expand All @@ -248,9 +251,6 @@ async def async_step_user(
mode=selector.SelectSelectorMode.DROPDOWN,
)
),
vol.Optional(CONF_USE_GPS, default=DEFAULT_USE_GPS): selector.BooleanSelector(
selector.BooleanSelectorConfig()
),
}
)
# If there is no user input or there were errors, show the form again, including any errors that were found with the input.
Expand Down Expand Up @@ -393,6 +393,10 @@ async def async_step_init(
"suggested_value": self.config_entry.data.get(CONF_LANGUAGE, None)
},
): str,
vol.Optional(
CONF_USE_GPS,
default=(self.config_entry.data.get(CONF_USE_GPS, DEFAULT_USE_GPS)),
): selector.BooleanSelector(selector.BooleanSelectorConfig()),
vol.Optional(
CONF_EXTENDED_ATTR,
default=(self.config_entry.data.get(CONF_EXTENDED_ATTR, DEFAULT_EXTENDED_ATTR)),
Expand All @@ -417,10 +421,6 @@ async def async_step_init(
mode=selector.SelectSelectorMode.DROPDOWN,
)
),
vol.Optional(
CONF_USE_GPS,
default=(self.config_entry.data.get(CONF_USE_GPS, DEFAULT_USE_GPS)),
): selector.BooleanSelector(selector.BooleanSelectorConfig()),
}
)

Expand Down
22 changes: 16 additions & 6 deletions custom_components/places/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,17 @@
"map_zoom": "Map Zoom",
"api_key": "Email to use as OpenStreetMap API Key (optional)",
"language": "Language (optional)",
"use_gps_accuracy": "Use GPS Accuracy",
"extended_attr": "Enable Extended Attributes",
"show_time": "Show last updated time at end of state '(since xx:yy)'",
"date_format": "Date format to show at end of state when not changed >24h",
"use_gps_accuracy": "Use GPS Accuracy"
"date_format": "Date format to show at end of state when not changed >24h"
},
"description": "Create a new sensor\nSee [Configuration Options]({component_config_url}) on GitHub for details"
"description": "Create a new sensor\nSee [Configuration Options]({component_config_url}) on GitHub for details",
"data_description": {
"options": "See [Configuration Options]({component_config_url}) on GitHub for details",
"extended_attr": "Show extended attributes: wikidata_id, osm_dict, osm_details_dict, wikidata_dict (if they exist). Provides many additional attributes for advanced logic. Warning, this will make the attributes very long!",
"use_gps_accuracy": "Set this to False if your Device Tracker has a GPS Accuracy (gps_accuracy) attribute, but it always shows 0 even if the latitude and longitude are correct."
}
}
}
},
Expand All @@ -34,12 +39,17 @@
"map_zoom": "Map Zoom",
"api_key": "Email to use as OpenStreetMap API Key (optional)",
"language": "Language (optional)",
"use_gps_accuracy": "Use GPS Accuracy",
"extended_attr": "Enable Extended Attributes",
"show_time": "Show last updated time at end of state '(since xx:yy)'",
"date_format": "Date format to show at end of state when not changed >24h",
"use_gps_accuracy": "Use GPS Accuracy"
"date_format": "Date format to show at end of state when not changed >24h"
},
"description": "**Updating sensor: {sensor_name}**\nSee [Configuration Options]({component_config_url}) on GitHub for details"
"description": "**Updating sensor: {sensor_name}**\nSee [Configuration Options]({component_config_url}) on GitHub for details",
"data_description": {
"options": "See [Configuration Options]({component_config_url}) on GitHub for details",
"extended_attr": "Show extended attributes: wikidata_id, osm_dict, osm_details_dict, wikidata_dict (if they exist). Provides many additional attributes for advanced logic. Warning, this will make the attributes very long!",
"use_gps_accuracy": "Set this to False if your Device Tracker has a GPS Accuracy (gps_accuracy) attribute, but it always shows 0 even if the latitude and longitude are correct."
}
}
}
}
Expand Down
14 changes: 12 additions & 2 deletions custom_components/places/translations/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@
"show_time": "Показать время последнего обновления в конце состояния '(начиная с xx:yy)'",
"use_gps_accuracy": "Используйте точность GPS"
},
"description": "Создайте новый датчик\nПодробнее см. [Параметры конфигурации]({component_config_url}) на GitHub."
"description": "Создайте новый датчик\nПодробнее см. [Параметры конфигурации]({component_config_url}) на GitHub.",
"data_description": {
"options": "Подробнее см. [Параметры конфигурации]({component_config_url}) на GitHub",
"extended_attr": "Show extended attributes: wikidata_id, osm_dict, osm_details_dict, wikidata_dict (if they exist). Provides many additional attributes for advanced logic. Warning, this will make the attributes very long!",
"use_gps_accuracy": "Set this to False if your Device Tracker has a GPS Accuracy (gps_accuracy) attribute, but it always shows 0 even if the latitude and longitude are correct."
}
}
}
},
Expand All @@ -37,7 +42,12 @@
"show_time": "Показать время последнего обновления в конце состояния '(начиная с xx:yy)'",
"use_gps_accuracy": "Используйте точность GPS"
},
"description": "**Обновление сенсора: {sensor_name}**\nПодробности см. в [Параметры конфигурации]({component_config_url}) на GitHub."
"description": "**Обновление сенсора: {sensor_name}**\nПодробности см. в [Параметры конфигурации]({component_config_url}) на GitHub.",
"data_description": {
"options": "Подробнее см. [Параметры конфигурации]({component_config_url}) на GitHub",
"extended_attr": "Show extended attributes: wikidata_id, osm_dict, osm_details_dict, wikidata_dict (if they exist). Provides many additional attributes for advanced logic. Warning, this will make the attributes very long!",
"use_gps_accuracy": "Set this to False if your Device Tracker has a GPS Accuracy (gps_accuracy) attribute, but it always shows 0 even if the latitude and longitude are correct."
}
}
}
}
Expand Down
16 changes: 13 additions & 3 deletions custom_components/places/translations/sk.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@
"date_format": "Formát dátumu, ktorý sa zobrazí na konci stavu, keď sa nezmení >24 hodín",
"use_gps_accuracy": "Použite presnosť GPS"
},
"description": "Vytvorte nový senzor\nPodrobnosti nájdete v [Možnosti konfigurácie] ({component_config_url}) na GitHub"
"description": "Vytvorte nový senzor\nPodrobnosti nájdete v [Možnosti konfigurácie] ({component_config_url}) na GitHub",
"data_description": {
"options": "Podrobnosti nájdete v [Možnosti konfigurácie] ({component_config_url}) na GitHub",
"extended_attr": "Show extended attributes: wikidata_id, osm_dict, osm_details_dict, wikidata_dict (if they exist). Provides many additional attributes for advanced logic. Warning, this will make the attributes very long!",
"use_gps_accuracy": "Set this to False if your Device Tracker has a GPS Accuracy (gps_accuracy) attribute, but it always shows 0 even if the latitude and longitude are correct."
}
}
}
},
Expand All @@ -27,7 +32,7 @@
"init": {
"title": "Miesta: OpenStreetMap snímač",
"data": {
"devicetracker_id": "Tracked Entity ID",
"devicetracker_id": "ID sledovanej entity",
"home_zone": "Domáca zóna",
"options": "Možnosti zobrazenia",
"map_provider": "Poskytovateľ mapy",
Expand All @@ -39,7 +44,12 @@
"date_format": "Formát dátumu, ktorý sa zobrazí na konci stavu, keď sa nezmení >24 hodín",
"use_gps_accuracy": "Použite presnosť GPS"
},
"description": "**Aktualizuje sa senzor: {sensor_name}**\nPodrobnosti nájdete v [Možnosti konfigurácie]({component_config_url}) na GitHub"
"description": "**Aktualizuje sa senzor: {sensor_name}**\nPodrobnosti nájdete v [Možnosti konfigurácie]({component_config_url}) na GitHub",
"data_description": {
"options": "Podrobnosti nájdete v [Možnosti konfigurácie] ({component_config_url}) na GitHub",
"extended_attr": "Show extended attributes: wikidata_id, osm_dict, osm_details_dict, wikidata_dict (if they exist). Provides many additional attributes for advanced logic. Warning, this will make the attributes very long!",
"use_gps_accuracy": "Set this to False if your Device Tracker has a GPS Accuracy (gps_accuracy) attribute, but it always shows 0 even if the latitude and longitude are correct."
}
}
}
}
Expand Down
14 changes: 12 additions & 2 deletions custom_components/places/translations/uk.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@
"show_time": "Показати час останнього оновлення в кінці стану '(з xx:yy)'",
"use_gps_accuracy": "Використовуйте точність GPS"
},
"description": "Create a new sensor\nSee [Configuration Options]({component_config_url}) on GitHub for details"
"description": "Create a new sensor\nДетальніше див. [Параметри конфігурації]({component_config_url}) на GitHub",
"data_description": {
"options": "Детальніше див. [Параметри конфігурації]({component_config_url}) на GitHub",
"extended_attr": "Show extended attributes: wikidata_id, osm_dict, osm_details_dict, wikidata_dict (if they exist). Provides many additional attributes for advanced logic. Warning, this will make the attributes very long!",
"use_gps_accuracy": "Set this to False if your Device Tracker has a GPS Accuracy (gps_accuracy) attribute, but it always shows 0 even if the latitude and longitude are correct."
}
}
}
},
Expand All @@ -37,7 +42,12 @@
"show_time": "Показати час останнього оновлення в кінці стану '(з xx:yy)'",
"use_gps_accuracy": "Використовуйте точність GPS"
},
"description": "**Оновлення датчика: {sensor_name}**\nДетальніше див. [Параметри конфігурації]({component_config_url}) на GitHub"
"description": "**Оновлення датчика: {sensor_name}**\nДетальніше див. [Параметри конфігурації]({component_config_url}) на GitHub",
"data_description": {
"options": "Детальніше див. [Параметри конфігурації]({component_config_url}) на GitHub",
"extended_attr": "Show extended attributes: wikidata_id, osm_dict, osm_details_dict, wikidata_dict (if they exist). Provides many additional attributes for advanced logic. Warning, this will make the attributes very long!",
"use_gps_accuracy": "Set this to False if your Device Tracker has a GPS Accuracy (gps_accuracy) attribute, but it always shows 0 even if the latitude and longitude are correct."
}
}
}
}
Expand Down

0 comments on commit d081bd1

Please sign in to comment.