Skip to content

Commit 6673839

Browse files
authored
Merge pull request #3811 from bramstroker/feat/analytics-language
Add default language to analytics data
2 parents 4c589c3 + bf00942 commit 6673839

3 files changed

Lines changed: 3 additions & 0 deletions

File tree

custom_components/powercalc/analytics/analytics.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ async def _prepare_payload(self) -> dict:
163163
"install_date": await self._get_install_date(),
164164
"powercalc_version": powercalc_integration.version,
165165
"ha_version": HA_VERSION,
166+
"language": self.hass.config.language,
166167
"config_entry_count": len(get_entries_excluding_global_config(self.hass)),
167168
"custom_profile_count": await self._get_custom_profile_count(),
168169
"has_global_gui_config": global_config_entry is not None,

docs/source/misc/analytics.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ No per-device identifiers are included.
8787
"ha_version": "2025.10.0.dev0",
8888
"install_id": "081ac191-2667-4242-8226-ecc66b1f7e9e",
8989
"install_date": "2023-01-15T12:34:56.789012",
90+
"language": "en",
9091
"group_sizes": {
9192
"2": 1,
9293
"5": 1

tests/analytics/test_analytics.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ async def test_send_analytics_success(
9393
assert len(aioclient_mock.mock_calls) == 1
9494
mock_call = aioclient_mock.mock_calls[0]
9595
posted_json = mock_call[2]
96+
assert posted_json["language"] == "en"
9697
assert posted_json["custom_profile_count"] > 50
9798
assert posted_json["counts"]["by_config_type"] == {"yaml": 2}
9899
assert posted_json["counts"]["by_sensor_type"] == {SensorType.VIRTUAL_POWER: 2}

0 commit comments

Comments
 (0)