summaryrefslogtreecommitdiff
path: root/include/py/homekit/pio/products.py
diff options
context:
space:
mode:
Diffstat (limited to 'include/py/homekit/pio/products.py')
-rw-r--r--include/py/homekit/pio/products.py7
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