Skip to content

Commit

Permalink
Merge pull request #47 from xirixiz/4.1.5
Browse files Browse the repository at this point in the history
4.1.5
  • Loading branch information
xirixiz authored Feb 11, 2020
2 parents 8be3585 + 52ecc5d commit 6a9cd1c
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 14 deletions.
2 changes: 1 addition & 1 deletion custom_components/afvalwijzer/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "Afvalwijzer",
"documentation": "https://github.com/xirixiz/Home-Assistant-Sensor-Afvalwijzer",
"requirements": [
"afvaldienst==0.6.2"
"afvaldienst==0.6.4"
],
"dependencies": [],
"codeowners": [
Expand Down
12 changes: 8 additions & 4 deletions custom_components/afvalwijzer/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
@ Description : Afvalwijzer Json/Scraper Sensor - It queries mijnafvalwijzer.nl or afvalstoffendienstkalender.nl.
"""

VERSION = '4.1.4'
VERSION = '4.1.5'

from Afvaldienst import Afvaldienst
from datetime import date, datetime, timedelta
Expand All @@ -27,6 +27,7 @@
CONST_ZIPCODE = 'zipcode'
CONST_HOUSENUMBER = 'housenumber'
CONST_SUFFIX = 'suffix'
CONST_COUNT_TODAY = 'count_today'
CONST_LABEL = 'default_label'

SCAN_INTERVAL = timedelta(seconds=30)
Expand All @@ -39,6 +40,7 @@
vol.Required(CONST_ZIPCODE): cv.string,
vol.Required(CONST_HOUSENUMBER): cv.string,
vol.Optional(CONST_SUFFIX, default=""): cv.string,
vol.Optional(CONST_COUNT_TODAY, default="no"): cv.string,
vol.Optional(CONST_LABEL, default="Geen"): cv.string,
})

Expand All @@ -49,13 +51,14 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
zipcode = config.get(CONST_ZIPCODE)
housenumber = config.get(CONST_HOUSENUMBER)
suffix = config.get(CONST_SUFFIX)
count_today = config.get(CONST_COUNT_TODAY)

_LOGGER.debug("Afvalwijzer provider = %s", provider)
_LOGGER.debug("Afvalwijzer zipcode = %s", zipcode)
_LOGGER.debug("Afvalwijzer housenumber = %s", housenumber)

try:
afvaldienst = Afvaldienst(provider, zipcode, housenumber, suffix)
afvaldienst = Afvaldienst(provider, zipcode, housenumber, suffix, count_today)
except ValueError as err:
_LOGGER.error("Check afvaldienst platform settings %s", err.args)
raise
Expand Down Expand Up @@ -150,9 +153,10 @@ def update(self):
zipcode = self._config.get(CONST_ZIPCODE)
housenumber = self._config.get(CONST_HOUSENUMBER)
suffix = self._config.get(CONST_SUFFIX)
count_today = self._config.get(CONST_COUNT_TODAY)

try:
afvaldienst = Afvaldienst(provider, zipcode, housenumber, suffix)
afvaldienst = Afvaldienst(provider, zipcode, housenumber, suffix, count_today)
except ValueError as err:
_LOGGER.error("Check afvaldienst platform settings %s", err.args)
raise
Expand Down Expand Up @@ -187,4 +191,4 @@ def update(self):
except ValueError as err:
_LOGGER.error("Check trash_schedule_firstwastedate %s", err.args)
self.trash_schedule_firstwastedate = self._config.get(CONST_LABEL)
raise
raise
2 changes: 1 addition & 1 deletion custom_updater.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sensor.afvalwijzer": {
"version": "4.1.4",
"version": "4.1.5",
"local_location": "/custom_components/afvalwijzer/__init__.py",
"remote_location": "https://raw.githubusercontent.com/xirixiz/Home-Assistant-Sensor-Afvalwijzer/master/custom_components/afvalwijzer/__init__.py",
"visit_repo": "https://github.com/xirixiz/Home-Assistant-Sensor-Afvalwijzer/",
Expand Down
1 change: 1 addition & 0 deletions info.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
zipcode: postcode # Required
housenumber: huisnummer # Required
suffix: toevoeging # Optional
count_today: vandaag meetellen # Optional - Default = no
default_label: label # Optional - Default is 'Geen'
```
9 changes: 1 addition & 8 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ logger:
default: info
logs:
custom_components.afvalwijzer: debug
custom_components.sensor.afvalwijzer: debug
```
## Example configuration
Expand All @@ -73,16 +72,10 @@ Here's an example of my own Home Asisstant config: https://github.com/xirixiz/ho
zipcode: postcode # Required
housenumber: huisnummer # Required
suffix: toevoeging # Optional
count_today: vandaag meetellen # Optional - Default = no
default_label: label # Optional - Default is 'Geen'
```
```yaml
- platform: afvalwijzer # Required
provider: mijnafvalwijzer # Optional - mijnafvalwijzer (default) or afvalstoffendienstkalender
zipcode: 1111AA # Required
housenumber: 11 # Required
```
###### INPUT BOOLEAN (FOR AUTOMATION)
```yaml
input_boolean:
Expand Down

0 comments on commit 6a9cd1c

Please sign in to comment.