Add config flow to worldclock (#33702)

This commit is contained in:
G Johansson 2024-07-19 10:08:28 +02:00 committed by GitHub
parent c401681e3e
commit f5de08b574
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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).