diff options
author | Evgeny Zinoviev <me@ch1p.io> | 2023-10-05 01:36:24 +0300 |
---|---|---|
committer | Evgeny Zinoviev <me@ch1p.io> | 2023-10-05 01:36:24 +0300 |
commit | 17b447646752cb141c30684046906961e8d0af9f (patch) | |
tree | 251e459fce0b781726107791cb667d40a07362b8 /include/py/homekit/pio | |
parent | 69adc549d317217b275a3e0cca689a9b1e7d3263 (diff) |
pio, mqtt: multiple fixes
Diffstat (limited to 'include/py/homekit/pio')
-rw-r--r-- | include/py/homekit/pio/products.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/py/homekit/pio/products.py b/include/py/homekit/pio/products.py index 5b40aae..3d5034f 100644 --- a/include/py/homekit/pio/products.py +++ b/include/py/homekit/pio/products.py @@ -41,6 +41,11 @@ def platformio_ini(product_config: dict, if node_id not in MqttNodesConfig().get_nodes().keys(): raise ValueError(f'node id "{node_id}" is not specified in the config!') + try: + node_defines = MqttNodesConfig().get_node(node_id)['defines'] + except KeyError: + node_defines = None + # defines defines = { **product_config['common_defines'], @@ -66,6 +71,8 @@ def platformio_ini(product_config: dict, if build_specific_defines: for k, v in build_specific_defines.items(): defines[k] = v + if node_defines: + defines = {**defines, **node_defines} defines = OrderedDict(sorted(defines.items(), key=lambda t: t[0])) # libs |