Skip to content

Commit

Permalink
fix datesort ximmio
Browse files Browse the repository at this point in the history
  • Loading branch information
Bram van Dartel committed Feb 23, 2022
1 parent 720e365 commit 5bc4f3e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
4 changes: 3 additions & 1 deletion custom_components/afvalwijzer/collector/ximmio.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,12 @@ def get_waste_data_provider(self):
item["_pickupTypeText"].strip().lower()
)
temp["date"] = datetime.strptime(
item["pickupDates"][0], "%Y-%m-%dT%H:%M:%S"
sorted(item["pickupDates"])[0], "%Y-%m-%dT%H:%M:%S"
).strftime("%Y-%m-%d")
waste_data_raw_formatted.append(temp)

print (waste_data_raw_formatted)

for item in waste_data_raw_formatted:
item_date = datetime.strptime(item["date"], "%Y-%m-%d")
item_name = item["type"]
Expand Down
2 changes: 1 addition & 1 deletion custom_components/afvalwijzer/const/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

API = "api"
NAME = "afvalwijzer"
VERSION = "2022.02.01"
VERSION = "2022.02.02"
ISSUE_URL = "https://github.com/xirixiz/homeassistant-afvalwijzer/issues"

_LOGGER = logging.getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion custom_components/afvalwijzer/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"domain": "afvalwijzer",
"name": "Afvalwijzer",
"version": "2022.02.01",
"version": "2022.02.02",
"iot_class": "cloud_polling",
"documentation": "https://github.com/xirixiz/homeassistant-afvalwijzer/blob/master/README.md",
"issue_tracker": "https://github.com/xirixiz/homeassistant-afvalwijzer/issues",
Expand Down
8 changes: 7 additions & 1 deletion custom_components/afvalwijzer/test/test_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

# Common
suffix = ""
exclude_pickup_today = "True"
exclude_pickup_today = "False"
default_label = "Geen"
exclude_list = ""

Expand All @@ -38,6 +38,12 @@
# postal_code = "2201XZ"
# street_number = "38"

# Twente
provider = "twentemilieu"
postal_code = "7642JH"
street_number = "5"


if provider in SENSOR_COLLECTORS_AFVALWIJZER:
collector = MijnAfvalWijzerCollector(
provider,
Expand Down

0 comments on commit 5bc4f3e

Please sign in to comment.