Add alias as accepted lookup value for area_id and floor_id templates

This commit is contained in:
formatBCE 2024-09-20 20:57:39 +00:00
parent 6ed4d8692a
commit 734fe8e8f6

View File

@ -466,7 +466,7 @@ The same thing can also be expressed as a test:
### Floors
- `floors()` returns the full list of floor IDs.
- `floor_id(lookup_value)` returns the floor ID for a given device ID, entity ID, area ID, or area name. Can also be used as a filter.
- `floor_id(lookup_value)` returns the floor ID for a given floor name or alias, device ID, entity ID, area ID, or area name or alias. Can also be used as a filter.
- `floor_name(lookup_value)` returns the floor name for a given device ID, entity ID, area ID, or floor ID. Can also be used as a filter.
- `floor_areas(floor_name_or_id)` returns the list of area IDs tied to a given floor ID or name. Can also be used as a filter.
@ -482,6 +482,10 @@ The same thing can also be expressed as a test:
{{ floor_id('First floor') }} # 'first_floor'
```
```text
{{ floor_id('First floor alias') }} # 'first_floor'
```
```text
{{ floor_id('my_device_id') }} # 'second_floor'
```
@ -511,7 +515,7 @@ The same thing can also be expressed as a test:
### Areas
- `areas()` returns the full list of area IDs
- `area_id(lookup_value)` returns the area ID for a given device ID, entity ID, or area name. Can also be used as a filter.
- `area_id(lookup_value)` returns the area ID for a given device ID, entity ID, or area name or alias. Can also be used as a filter.
- `area_name(lookup_value)` returns the area name for a given device ID, entity ID, or area ID. Can also be used as a filter.
- `area_entities(area_name_or_id)` returns the list of entity IDs tied to a given area ID or name. Can also be used as a filter.
- `area_devices(area_name_or_id)` returns the list of device IDs tied to a given area ID or name. Can also be used as a filter.
@ -528,6 +532,10 @@ The same thing can also be expressed as a test:
{{ area_id('Living Room') }} # 'deadbeefdeadbeefdeadbeefdeadbeef'
```
```text
{{ area_id('Living Room Alias') }} # 'deadbeefdeadbeefdeadbeefdeadbeef'
```
```text
{{ area_id('my_device_id') }} # 'deadbeefdeadbeefdeadbeefdeadbeef'
```