pio, mqtt: multiple fixes
This commit is contained in:
parent
69adc549d3
commit
17b4476467
@ -119,7 +119,7 @@ void Mqtt::reconnect() {
|
|||||||
void Mqtt::disconnect() {
|
void Mqtt::disconnect() {
|
||||||
// TODO test how this works???
|
// TODO test how this works???
|
||||||
reconnectTimer.detach();
|
reconnectTimer.detach();
|
||||||
client.disconnect();
|
client.disconnect(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Mqtt::loop() {
|
void Mqtt::loop() {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "homekit_mqtt",
|
"name": "homekit_mqtt",
|
||||||
"version": "1.0.11",
|
"version": "1.0.12",
|
||||||
"build": {
|
"build": {
|
||||||
"flags": "-I../../include"
|
"flags": "-I../../include"
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "homekit_temphum",
|
"name": "homekit_temphum",
|
||||||
"version": "1.0.3",
|
"version": "1.0.4",
|
||||||
"build": {
|
"build": {
|
||||||
"flags": "-I../../include"
|
"flags": "-I../../include"
|
||||||
}
|
}
|
||||||
|
@ -109,7 +109,12 @@ class MqttNodesConfig(ConfigUnit):
|
|||||||
'legacy_topics': {'type': 'boolean'}
|
'legacy_topics': {'type': 'boolean'}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'password': {'type': 'string'}
|
'password': {'type': 'string'},
|
||||||
|
'defines': {
|
||||||
|
'type': 'dict',
|
||||||
|
'keysrules': {'type': 'string'},
|
||||||
|
'valuesrules': {'type': ['string', 'integer']}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -74,4 +74,4 @@ class MqttOtaModule(MqttModule):
|
|||||||
if not self._initialized:
|
if not self._initialized:
|
||||||
self._ota_request = (filename, qos)
|
self._ota_request = (filename, qos)
|
||||||
else:
|
else:
|
||||||
self.do_push_ota(filename, qos)
|
self.do_push_ota(self._mqtt_node_ref.secret, filename, qos)
|
||||||
|
@ -41,6 +41,11 @@ def platformio_ini(product_config: dict,
|
|||||||
if node_id not in MqttNodesConfig().get_nodes().keys():
|
if node_id not in MqttNodesConfig().get_nodes().keys():
|
||||||
raise ValueError(f'node id "{node_id}" is not specified in the config!')
|
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
|
||||||
defines = {
|
defines = {
|
||||||
**product_config['common_defines'],
|
**product_config['common_defines'],
|
||||||
@ -66,6 +71,8 @@ def platformio_ini(product_config: dict,
|
|||||||
if build_specific_defines:
|
if build_specific_defines:
|
||||||
for k, v in build_specific_defines.items():
|
for k, v in build_specific_defines.items():
|
||||||
defines[k] = v
|
defines[k] = v
|
||||||
|
if node_defines:
|
||||||
|
defines = {**defines, **node_defines}
|
||||||
defines = OrderedDict(sorted(defines.items(), key=lambda t: t[0]))
|
defines = OrderedDict(sorted(defines.items(), key=lambda t: t[0]))
|
||||||
|
|
||||||
# libs
|
# libs
|
||||||
|
Loading…
x
Reference in New Issue
Block a user