From 7b9550773d5f09c93d86a914cf990b464c155a21 Mon Sep 17 00:00:00 2001 From: Stefan Allius Date: Sun, 9 Jun 2024 01:25:06 +0200 Subject: [PATCH] don't use depricated varn anymore --- app/src/gen3plus/solarman_v5.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/app/src/gen3plus/solarman_v5.py b/app/src/gen3plus/solarman_v5.py index 64e4536..f38673c 100644 --- a/app/src/gen3plus/solarman_v5.py +++ b/app/src/gen3plus/solarman_v5.py @@ -339,8 +339,8 @@ class SolarmanV5(Message): def send_modbus_cb(self, pdu: bytearray, log_lvl: int, state: str): if self.state != self.STATE_UP: - logger.warn(f'[{self.node_id}] ignore MODBUS cmd,' - ' cause the state is not UP anymore') + logger.warning(f'[{self.node_id}] ignore MODBUS cmd,' + ' cause the state is not UP anymore') return self.__build_header(0x4510) self._send_buffer += struct.pack(' None: if self.state != self.STATE_UP: - logger.warn(f'[{self.node_id}] ignore AT+ cmd,' - ' as the state is not UP') + logger.warning(f'[{self.node_id}] ignore AT+ cmd,' + ' as the state is not UP') return AT_cmd = AT_cmd.strip() @@ -375,8 +375,7 @@ class SolarmanV5(Message): node_id = self.node_id key = 'at_resp' logger.info(f'{key}: {data_json}') - asyncio.ensure_future( - self.publish_mqtt(f'{self.entity_prfx}{node_id}{key}', data_json)) # noqa: E501 + await self.publish_mqtt(f'{self.entity_prfx}{node_id}{key}', data_json) # noqa: E501 return self.forward_at_cmd_resp = False