From 3305fb874d8b51794d57745f053ab09c9687e925 Mon Sep 17 00:00:00 2001 From: Marijn Giesen Date: Tue, 10 Dec 2019 13:51:41 +0100 Subject: [PATCH] Fixed bug introduced with pull request 28 --- custom_components/afvalwijzer/sensor.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/custom_components/afvalwijzer/sensor.py b/custom_components/afvalwijzer/sensor.py index 42ce81d..e1de638 100644 --- a/custom_components/afvalwijzer/sensor.py +++ b/custom_components/afvalwijzer/sensor.py @@ -140,7 +140,8 @@ def update(self): for item in self.data.data: logger.debug("Update called for item: {}".format(item)) if item['key'] == self._name: - self._state = item['value'].strip() + + self._state = item['value'] class TrashCollectionSchedule(object): @@ -206,7 +207,7 @@ def days(start, end): trashSchedule.append(trashToday) multiTrashToday.append(item['nameType']) if len(multiTrashToday) != 0: - trashToday['value'] = ', '.join(multiTrashToday) + trashToday['value'] = ', '.join(multiTrashToday).strip() if item['date'] == tomorrow: trashType[name] = "tomorrow" @@ -214,7 +215,7 @@ def days(start, end): trashSchedule.append(trashTomorrow) multiTrashTomorrow.append(item['nameType']) if len(multiTrashTomorrow) != 0: - trashTomorrow['value'] = ', '.join(multiTrashTomorrow) + trashTomorrow['value'] = ', '.join(multiTrashTomorrow).strip() # Setup scraper request url = self._config.get(CONST_URL)