From f5de08b574a5db0a521a13ecbacfe6af0bad457a Mon Sep 17 00:00:00 2001 From: G Johansson Date: Fri, 19 Jul 2024 10:08:28 +0200 Subject: [PATCH] Add config flow to worldclock (#33702) --- source/_integrations/worldclock.markdown | 41 ++++++------------------ 1 file changed, 10 insertions(+), 31 deletions(-) diff --git a/source/_integrations/worldclock.markdown b/source/_integrations/worldclock.markdown index 920dbf0523a..bee4e95e9b4 100644 --- a/source/_integrations/worldclock.markdown +++ b/source/_integrations/worldclock.markdown @@ -9,6 +9,7 @@ ha_quality_scale: internal ha_codeowners: - '@fabaff' ha_domain: worldclock +ha_config_flow: true ha_platforms: - sensor ha_integration_type: integration @@ -19,37 +20,15 @@ related: The `worldclock` {% term integration %} simply displays the current time in a different time zone. -## Configuration +{% include integrations/config_flow.md %} -To enable this {% term integration %} in your installation, add the following to your {% term "`configuration.yaml`" %} file. -{% include integrations/restart_ha_after_config_inclusion.md %} - -```yaml -# Example configuration.yaml entry -sensor: - - platform: worldclock - time_zone: America/New_York -``` - -{% configuration %} -time_zone: - description: The resource or endpoint that contains the value. - required: true - type: string -name: +{% configuration_basic %} +Timezone: + description: Select a valid timezone from the list. +Name: description: The name of the sensor, e.g., the city. - required: false - type: string - default: Worldclock Sensor -time_format: - description: The time format. - required: false - type: string - default: "%H:%M" -{% endconfiguration %} +Time format: + description: The time format, defaults to "%H:%M" which represents hour and minute. +{% endconfiguration_basic %} -For valid time zones, check the **TZ** column in the [Wikipedia overview](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones), or get the full list from the [pytz](https://pypi.python.org/pypi/pytz) module. - -```shell -python3 -c "import pytz;print(pytz.all_timezones)" -``` +For valid time zones, check the **TZ** column in the [Wikipedia overview](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).