diff options
Diffstat (limited to 'src/home/mqtt/module/ota.py')
-rw-r--r-- | src/home/mqtt/module/ota.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/home/mqtt/module/ota.py b/src/home/mqtt/module/ota.py index e71cccc..70c5475 100644 --- a/src/home/mqtt/module/ota.py +++ b/src/home/mqtt/module/ota.py @@ -41,7 +41,7 @@ class OtaPayload(MqttPayload): class MqttOtaModule(MqttModule): - _ota_request: Optional[tuple[str, str, int]] + _ota_request: Optional[tuple[str, int]] def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) @@ -52,9 +52,9 @@ class MqttOtaModule(MqttModule): mqtt.subscribe_module("otares", self) if self._ota_request is not None: - secret, filename, qos = self._ota_request + filename, qos = self._ota_request self._ota_request = None - self.do_push_ota(secret, filename, qos) + self.do_push_ota(self._mqtt_node_ref.secret, filename, qos) def handle_payload(self, mqtt: MqttNode, topic: str, payload: bytes) -> Optional[MqttPayload]: if topic == 'otares': @@ -69,10 +69,9 @@ class MqttOtaModule(MqttModule): qos=qos) def push_ota(self, - secret: str, filename: str, qos: int): if not self._initialized: - self._ota_request = (secret, filename, qos) + self._ota_request = (filename, qos) else: - self.do_push_ota(secret, filename, qos) + self.do_push_ota(filename, qos) |