Skip to content

Conversation

@puddly
Copy link
Contributor

@puddly puddly commented Nov 26, 2025

To support querying the adapter for regulatory limit data, we need to pass country code data through from Home Assistant Core and into zigpy. This requires a tiny change on the Core side:

diff --git a/homeassistant/components/zha/__init__.py b/homeassistant/components/zha/__init__.py
index 4009936a50a..16c64fd9016 100644
--- a/homeassistant/components/zha/__init__.py
+++ b/homeassistant/components/zha/__init__.py
@@ -253,6 +253,7 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> b
     def update_config(event: Event) -> None:
         """Handle Core config update."""
         zha_gateway.config.local_timezone = ZoneInfo(hass.config.time_zone)
+        zha_gateway.config.country_code = hass.config.country
 
     config_entry.async_on_unload(
         hass.bus.async_listen(EVENT_CORE_CONFIG_UPDATE, update_config)
diff --git a/homeassistant/components/zha/helpers.py b/homeassistant/components/zha/helpers.py
index bde0d636a97..aed55eb6085 100644
--- a/homeassistant/components/zha/helpers.py
+++ b/homeassistant/components/zha/helpers.py
@@ -1370,6 +1370,7 @@ def create_zha_config(hass: HomeAssistant, ha_zha_data: HAZHAData) -> ZHAData:
             device_overrides=overrides_config,
         ),
         local_timezone=ZoneInfo(hass.config.time_zone),
+        country_code=hass.config.country,
     )

@codecov
Copy link

codecov bot commented Nov 26, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.96%. Comparing base (5cc4904) to head (84e8127).
⚠️ Report is 2 commits behind head on dev.

Additional details and impacted files
@@           Coverage Diff           @@
##              dev     #588   +/-   ##
=======================================
  Coverage   96.96%   96.96%           
=======================================
  Files          63       63           
  Lines       10553    10557    +4     
=======================================
+ Hits        10233    10237    +4     
  Misses        320      320           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@puddly puddly force-pushed the puddly/country-code-passthrough branch from f69c264 to 2dae5f5 Compare November 26, 2025 02:17
Co-authored-by: TheJulianJES <TheJulianJES@users.noreply.github.com>
@puddly puddly merged commit 5f151c1 into zigpy:dev Nov 26, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants