Skip to content

Commit 1f61fce

Browse files
authored
Update afvalbeheer.py
1 parent 868371e commit 1f61fce

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

afvalbeheer.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
"""
22
Sensor component for waste pickup dates from dutch waste collectors (using the http://www.opzet.nl app)
33
Original Author: Pippijn Stortelder
4-
Current Version: 2.0.2 20190122 - Pippijn Stortelder
4+
Current Version: 2.0.3 20190122 - Pippijn Stortelder
55
20190116 - Merged different waste collectors into 1 component
66
20190119 - Added an option to change date format and fixed spelling mistakes
7-
20190122 - Refactor code
7+
20190122 - Refactor code and bug fix
88
99
Description:
1010
Provides sensors for the following Dutch waste collectors;
@@ -38,12 +38,11 @@
3838
Configuration.yaml:
3939
sensor:
4040
- platform: afvalbeheer
41-
waste_collector: Blink
41+
wastecollector: Blink
4242
dateformat: '%d-%m-%Y'
4343
resources: (at least 1 required)
4444
- restafval
4545
- gft
46-
- gftgratis
4746
- papier
4847
- pmd
4948
postcode: 1111AA (required)
@@ -62,7 +61,7 @@
6261
from homeassistant.util import Throttle
6362
from homeassistant.helpers.entity import Entity
6463

65-
__version__ = '2.0.2'
64+
__version__ = '2.0.3'
6665

6766
_LOGGER = logging.getLogger(__name__)
6867

@@ -160,7 +159,7 @@ def update(self):
160159
address_code = response[0]['bagId']
161160
url = self.main_url + '/rest/adressen/' + address_code + '/afvalstromen'
162161
request_json = requests.get(url).json()
163-
if not response:
162+
if not request_json:
164163
_LOGGER.error('No Waste data found!')
165164
else:
166165
COLLECTOR_WASTE_ID[self.waste_collector] = {}

0 commit comments

Comments
 (0)