From 24127f9df5c50ada01740197ac4446479e12f52d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrius=20=C5=A0tikonas?= Date: Mon, 7 Dec 2020 00:54:29 +0000 Subject: [PATCH] Fix zone rename function and expected reply checking. --- neohub.py | 2 +- neostat.py | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/neohub.py b/neohub.py index 9ce70be..284b6bc 100644 --- a/neohub.py +++ b/neohub.py @@ -47,7 +47,7 @@ class NeoHub: if expected_reply is None: return reply else: - if reply == expected_reply: + if reply.__dict__ == expected_reply: return True else: self._logger.error(f"Unexpected reply: {reply}") diff --git a/neostat.py b/neostat.py index 5b9fb57..00aca16 100644 --- a/neostat.py +++ b/neostat.py @@ -41,11 +41,9 @@ class NeoStat: """ message = {"ZONE_TITLE": [self.name, new_name]} - reply = {"result": "flashing led"} + reply = {"result": "zone renamed"} result = await self._hub._send(message, reply) - if result: - self.name = new_name return result async def remove(self):