Skip to content

Commit 4add346

Browse files
authored
Deduplicate strings and fix sentence-casing in proximity (home-assistant#147777)
* Deduplicate strings and fix sentence-casing in `proximity` * Update test_init.py
1 parent 369c8d1 commit 4add346

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

homeassistant/components/proximity/strings.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"title": "Proximity",
33
"config": {
4-
"flow_title": "Proximity",
4+
"flow_title": "[%key:component::proximity::title%]",
55
"step": {
66
"user": {
77
"data": {
88
"zone": "Zone to track distance to",
99
"ignored_zones": "Zones to ignore",
10-
"tracked_entities": "Devices or Persons to track",
10+
"tracked_entities": "Devices or persons to track",
1111
"tolerance": "Tolerance distance"
1212
}
1313
}
@@ -21,34 +21,34 @@
2121
"step": {
2222
"init": {
2323
"data": {
24-
"zone": "Zone to track distance to",
25-
"ignored_zones": "Zones to ignore",
26-
"tracked_entities": "Devices or Persons to track",
27-
"tolerance": "Tolerance distance"
24+
"zone": "[%key:component::proximity::config::step::user::data::zone%]",
25+
"ignored_zones": "[%key:component::proximity::config::step::user::data::ignored_zones%]",
26+
"tracked_entities": "[%key:component::proximity::config::step::user::data::tracked_entities%]",
27+
"tolerance": "[%key:component::proximity::config::step::user::data::tolerance%]"
2828
}
2929
}
3030
}
3131
},
3232
"entity": {
3333
"sensor": {
3434
"dir_of_travel": {
35-
"name": "{tracked_entity} Direction of travel",
35+
"name": "{tracked_entity} direction of travel",
3636
"state": {
3737
"arrived": "Arrived",
3838
"away_from": "Away from",
3939
"stationary": "Stationary",
4040
"towards": "Towards"
4141
}
4242
},
43-
"dist_to_zone": { "name": "{tracked_entity} Distance" },
43+
"dist_to_zone": { "name": "{tracked_entity} distance" },
4444
"nearest": { "name": "Nearest device" },
4545
"nearest_dir_of_travel": {
4646
"name": "Nearest direction of travel",
4747
"state": {
48-
"arrived": "Arrived",
49-
"away_from": "Away from",
50-
"stationary": "Stationary",
51-
"towards": "Towards"
48+
"arrived": "[%key:component::proximity::entity::sensor::dir_of_travel::state::arrived%]",
49+
"away_from": "[%key:component::proximity::entity::sensor::dir_of_travel::state::away_from%]",
50+
"stationary": "[%key:component::proximity::entity::sensor::dir_of_travel::state::stationary%]",
51+
"towards": "[%key:component::proximity::entity::sensor::dir_of_travel::state::towards%]"
5252
}
5353
},
5454
"nearest_dist_to_zone": { "name": "Nearest distance" }

tests/components/proximity/test_init.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,7 @@ async def test_sensor_unique_ids(
871871
assert entity
872872
assert entity.unique_id == f"{mock_config.entry_id}_{t1.id}_dist_to_zone"
873873
state = hass.states.get(sensor_t1)
874-
assert state.attributes.get(ATTR_FRIENDLY_NAME) == "Home Test tracker 1 Distance"
874+
assert state.attributes.get(ATTR_FRIENDLY_NAME) == "Home Test tracker 1 distance"
875875

876876
entity = entity_registry.async_get("sensor.home_test2_distance")
877877
assert entity

0 commit comments

Comments
 (0)