Skip to content

Commit 55690bd

Browse files
committed
Hide firmware-level manual source routing behind manual_source_routing
1 parent a24c84e commit 55690bd

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

bellows/config/__init__.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
cv_boolean,
1919
)
2020

21+
CONF_BELLOWS_CONFIG = "bellows_config"
22+
CONF_MANUAL_SOURCE_ROUTING = "manual_source_routing"
23+
2124
CONF_USE_THREAD = "use_thread"
2225
CONF_EZSP_CONFIG = "ezsp_config"
2326
CONF_EZSP_POLICIES = "ezsp_policies"
@@ -31,6 +34,12 @@
3134
{vol.Optional(str): int}
3235
),
3336
vol.Optional(CONF_USE_THREAD, default=True): cv_boolean,
37+
# The above config really should belong in here
38+
vol.Optional(CONF_BELLOWS_CONFIG, default={}): vol.Schema(
39+
{
40+
vol.Optional(CONF_MANUAL_SOURCE_ROUTING, default=False): bool,
41+
}
42+
),
3443
}
3544
)
3645

bellows/zigbee/application.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@
2525

2626
import bellows
2727
from bellows.config import (
28+
CONF_BELLOWS_CONFIG,
2829
CONF_EZSP_CONFIG,
2930
CONF_EZSP_POLICIES,
31+
CONF_MANUAL_SOURCE_ROUTING,
3032
CONF_USE_THREAD,
3133
CONFIG_SCHEMA,
3234
)
@@ -781,7 +783,10 @@ async def _reset_mfg_id(self, mfg_id: int) -> None:
781783
async def _set_source_route(
782784
self, nwk: zigpy.types.NWK, relays: list[zigpy.types.NWK]
783785
) -> bool:
784-
if FirmwareFeatures.MANUAL_SOURCE_ROUTE in self._ezsp._xncp_features:
786+
if (
787+
FirmwareFeatures.MANUAL_SOURCE_ROUTE in self._ezsp._xncp_features
788+
and self.config[CONF_BELLOWS_CONFIG][CONF_MANUAL_SOURCE_ROUTING]
789+
):
785790
await self._ezsp.xncp_set_manual_source_route(nwk, relays)
786791
return True
787792
else:

0 commit comments

Comments
 (0)