From 09fa332fb04fc02eba37180c2ab5da3af7d7af75 Mon Sep 17 00:00:00 2001 From: bittles Date: Sat, 31 Dec 2022 11:18:26 -0500 Subject: [PATCH] catch more payloads --- custom_components/ecovacs/sucksbumper.py | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/custom_components/ecovacs/sucksbumper.py b/custom_components/ecovacs/sucksbumper.py index dd3ccc9..977ab57 100644 --- a/custom_components/ecovacs/sucksbumper.py +++ b/custom_components/ecovacs/sucksbumper.py @@ -948,10 +948,23 @@ class EcoVacsXMPP(ClientXMPP): def _handle_ctl(self, message): the_good_part = message.get_payload()[0][0] as_dict = self._ctl_to_dict(the_good_part) - the_other_part = message.get_payload()[0][1] - _LOGGER.debug("handle_ctl called with[0][1] the other part:") - _LOGGER.debug(the_other_part) - _LOGGER.debug("end of the_other_part") + if message.get_payload([0][1]: + the_other_part = message.get_payload()[0][1] + other_dict = self._ctl_to_dict(the_other_part) + _LOGGER.debug("handle_ctl called with[0][1] the other part:") + _LOGGER.debug(the_other_part) + _LOGGER.debug("other dict:" + _LOGGER.debug(other_dict) + _LOGGER.debug("end of the_other_part") + + if message.get_payload([1][0]: + the_another_part = message.get_payload()[1][0] + another_dict = self._ctl_to_dict(the_another_part) + _LOGGER.debug("handle_ctl called with[1][0] the another part:") + _LOGGER.debug(the_another_part) + _LOGGER.debug("another dict:" + _LOGGER.debug(another_dict) + _LOGGER.debug("end of the_another_part") if as_dict is not None: for s in self.ctl_subscribers: