mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Deduplicate strings and fix sentence-casing in proximity
(#147777)
* Deduplicate strings and fix sentence-casing in `proximity` * Update test_init.py
This commit is contained in:
parent
369c8d1e0d
commit
4add346272
@ -1,13 +1,13 @@
|
|||||||
{
|
{
|
||||||
"title": "Proximity",
|
"title": "Proximity",
|
||||||
"config": {
|
"config": {
|
||||||
"flow_title": "Proximity",
|
"flow_title": "[%key:component::proximity::title%]",
|
||||||
"step": {
|
"step": {
|
||||||
"user": {
|
"user": {
|
||||||
"data": {
|
"data": {
|
||||||
"zone": "Zone to track distance to",
|
"zone": "Zone to track distance to",
|
||||||
"ignored_zones": "Zones to ignore",
|
"ignored_zones": "Zones to ignore",
|
||||||
"tracked_entities": "Devices or Persons to track",
|
"tracked_entities": "Devices or persons to track",
|
||||||
"tolerance": "Tolerance distance"
|
"tolerance": "Tolerance distance"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -21,10 +21,10 @@
|
|||||||
"step": {
|
"step": {
|
||||||
"init": {
|
"init": {
|
||||||
"data": {
|
"data": {
|
||||||
"zone": "Zone to track distance to",
|
"zone": "[%key:component::proximity::config::step::user::data::zone%]",
|
||||||
"ignored_zones": "Zones to ignore",
|
"ignored_zones": "[%key:component::proximity::config::step::user::data::ignored_zones%]",
|
||||||
"tracked_entities": "Devices or Persons to track",
|
"tracked_entities": "[%key:component::proximity::config::step::user::data::tracked_entities%]",
|
||||||
"tolerance": "Tolerance distance"
|
"tolerance": "[%key:component::proximity::config::step::user::data::tolerance%]"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -32,7 +32,7 @@
|
|||||||
"entity": {
|
"entity": {
|
||||||
"sensor": {
|
"sensor": {
|
||||||
"dir_of_travel": {
|
"dir_of_travel": {
|
||||||
"name": "{tracked_entity} Direction of travel",
|
"name": "{tracked_entity} direction of travel",
|
||||||
"state": {
|
"state": {
|
||||||
"arrived": "Arrived",
|
"arrived": "Arrived",
|
||||||
"away_from": "Away from",
|
"away_from": "Away from",
|
||||||
@ -40,15 +40,15 @@
|
|||||||
"towards": "Towards"
|
"towards": "Towards"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dist_to_zone": { "name": "{tracked_entity} Distance" },
|
"dist_to_zone": { "name": "{tracked_entity} distance" },
|
||||||
"nearest": { "name": "Nearest device" },
|
"nearest": { "name": "Nearest device" },
|
||||||
"nearest_dir_of_travel": {
|
"nearest_dir_of_travel": {
|
||||||
"name": "Nearest direction of travel",
|
"name": "Nearest direction of travel",
|
||||||
"state": {
|
"state": {
|
||||||
"arrived": "Arrived",
|
"arrived": "[%key:component::proximity::entity::sensor::dir_of_travel::state::arrived%]",
|
||||||
"away_from": "Away from",
|
"away_from": "[%key:component::proximity::entity::sensor::dir_of_travel::state::away_from%]",
|
||||||
"stationary": "Stationary",
|
"stationary": "[%key:component::proximity::entity::sensor::dir_of_travel::state::stationary%]",
|
||||||
"towards": "Towards"
|
"towards": "[%key:component::proximity::entity::sensor::dir_of_travel::state::towards%]"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nearest_dist_to_zone": { "name": "Nearest distance" }
|
"nearest_dist_to_zone": { "name": "Nearest distance" }
|
||||||
|
@ -871,7 +871,7 @@ async def test_sensor_unique_ids(
|
|||||||
assert entity
|
assert entity
|
||||||
assert entity.unique_id == f"{mock_config.entry_id}_{t1.id}_dist_to_zone"
|
assert entity.unique_id == f"{mock_config.entry_id}_{t1.id}_dist_to_zone"
|
||||||
state = hass.states.get(sensor_t1)
|
state = hass.states.get(sensor_t1)
|
||||||
assert state.attributes.get(ATTR_FRIENDLY_NAME) == "Home Test tracker 1 Distance"
|
assert state.attributes.get(ATTR_FRIENDLY_NAME) == "Home Test tracker 1 distance"
|
||||||
|
|
||||||
entity = entity_registry.async_get("sensor.home_test2_distance")
|
entity = entity_registry.async_get("sensor.home_test2_distance")
|
||||||
assert entity
|
assert entity
|
||||||
|
Loading…
x
Reference in New Issue
Block a user