From 27b9bc4afee0eb1402272d7cf36a5c023c4abf5e Mon Sep 17 00:00:00 2001 From: bittles Date: Mon, 2 Jan 2023 15:54:12 -0500 Subject: [PATCH] convert to string for decoding? idk just trying stuff --- custom_components/ecovacs/sucksbumper.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/custom_components/ecovacs/sucksbumper.py b/custom_components/ecovacs/sucksbumper.py index c729c27..11f23e5 100644 --- a/custom_components/ecovacs/sucksbumper.py +++ b/custom_components/ecovacs/sucksbumper.py @@ -950,7 +950,7 @@ class EcoVacsXMPP(ClientXMPP): _LOGGER.debug(message) # the_good_part = str(message.payload.decode("utf-8")) # the_good_part = message.get_payload()[0][0] - the_good_part = str(message.get_payload().decode("utf-8")) + the_good_part = str(message.get_payload()) _LOGGER.debug("the_good_part in handle_ctl is :") _LOGGER.debug(message) # other_part = "{'ret': 'ok'}" @@ -981,8 +981,9 @@ class EcoVacsXMPP(ClientXMPP): # except IndexError: # _LOGGER.debug("No extra payload") - def _ctl_to_dict(self, xml): + def _ctl_to_dict(self, xmlstring): #Including changes from jasonarends @ 28da7c2 below + xml = ET.fromstring(xmlstring) result = xml.attrib.copy() if 'td' not in result: # This happens for commands with no response data, such as PlaySound