Skip to content

Commit

Permalink
Update mijnafvalwijzer.py
Browse files Browse the repository at this point in the history
- Add "None" or "Geen" label for next pickup day
- Sensor renamed to next_in_days
  • Loading branch information
xirixiz authored Dec 28, 2018
1 parent a12910a commit 69303b8
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions custom_components/sensor/mijnafvalwijzer.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"""
@ Authors : Bram van Dartel
@ Date : 27/12/2018
@ Date : 28/12/2018
@ Description : MijnAfvalwijzer Sensor - It queries mijnafvalwijzer.nl.
"""
VERSION = '1.1.7'
VERSION = '1.1.8'

from datetime import datetime, timedelta, date
import voluptuous as vol
Expand Down Expand Up @@ -164,8 +164,8 @@ def days(start, end):

if item['date'] > today:
if len(trashInDays) == 0:
trashType[name] = "days_to_next_pickup"
trashInDays['key'] = "days_to_next_pickup"
trashType[name] = "next_in_days"
trashInDays['key'] = "next_in_days"
trashInDays['value'] = (days(today, dateConvert))
tschedule.append(trashInDays)

Expand All @@ -181,6 +181,12 @@ def days(start, end):
multiTrashTomorrow.append(item['nameType'])
tschedule.append(trashTomorrow)

if len(trashInDays) == 0:
trashType[name] = "next_in_days"
trashInDays['key'] = 'next_in_days'
trashInDays['value'] = labelNone
tschedule.append(trashInDays)

if len(multiTrashToday) == 0:
trashToday = {}
trashType[name] = "today"
Expand Down

0 comments on commit 69303b8

Please sign in to comment.