New options for map card markers (#29017)

This commit is contained in:
karwosts 2023-09-25 08:29:58 -07:00 committed by GitHub
parent d3ef019217
commit 07a03b7bc7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,7 +27,7 @@ type:
type: string type: string
entities: entities:
required: true required: true
description: List of entity IDs. Either this or the `geo_location_sources` configuration option is required. description: List of entity IDs or `entity` objects (see below). Either this or the `geo_location_sources` configuration option is required.
type: list type: list
geo_location_sources: geo_location_sources:
required: true required: true
@ -75,6 +75,31 @@ hours_to_show:
</div> </div>
## Options For Entities
If you define entities as objects instead of strings (by adding `entity:` before entity ID), you can add more customization and configuration.
{% configuration %}
entity:
required: true
description: Entity ID.
type: string
name:
required: false
description: Replace the default label for the marker.
type: string
label_mode:
required: false
default: name
description: When set to `state`, renders the entity's state as the label for the map marker instead of the entity's name.
type: string
focus:
required: false
default: true
description: When set to `false`, this entity will not be considered for determining the default zoom or fit of the map.
type: boolean
{% endconfiguration %}
## Examples ## Examples
```yaml ```yaml
@ -99,5 +124,8 @@ entities:
type: map type: map
entities: entities:
- device_tracker.demo_paulus - device_tracker.demo_paulus
- entity: sensor.gas_station_gas_price
label_mode: state
focus: false
hours_to_show: 48 hours_to_show: 48
``` ```