Skip to content

Commit eae973e

Browse files
fixed a bug when recyclage was changed
1 parent b4fea88 commit eae973e

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ To display the next waste collection date as something more user-friendly, I mad
4646
{% set t = now() %} # compare with now
4747
{% set midnight = today_at() %}
4848
# convert sensor value as y-m-d to datetime
49-
{% set event_date = as_local(states('sensor.saguenay_rec_schedule') | as_datetime('%Y-%m-%d')) %}
49+
{% set event_date = as_local(states('sensor.saguenay_récupération_schedule') | as_datetime('%Y-%m-%d')) %}
5050
{% if event_date %}
5151
{% set delta = (event_date - midnight).days %} # get difference in days
5252
{% if delta == 0 %}

custom_components/saguenay_collection/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
"iot_class": "cloud_polling",
99
"issue_tracker": "https://github.com/DavidBilodeau1/saguenay_collection/issues",
1010
"requirements": ["requests"],
11-
"version": "1.0.4"
11+
"version": "1.0.5"
1212
}

custom_components/saguenay_collection/sensor.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
1919
await coordinator.async_config_entry_first_refresh()
2020

2121
sensors = [
22-
CollectionSensor(coordinator, "COM"),
23-
CollectionSensor(coordinator, "ORD"),
24-
CollectionSensor(coordinator, "REC"),
22+
CollectionSensor(coordinator, "compostage"),
23+
CollectionSensor(coordinator, "ordure"),
24+
CollectionSensor(coordinator, "récupération"),
2525
]
2626
async_add_entities(sensors)
2727

@@ -43,7 +43,7 @@ def fetch_data():
4343
results = {}
4444
for schedule in self.schedules:
4545
try:
46-
schedule_type = schedule.get("acronyme", "Unknown").lower()
46+
schedule_type = schedule.get("nom", "Unknown").lower()
4747
horaire_id = schedule.get("horaire_id")
4848

4949
_LOGGER.debug("Fetching data for schedule: %s with horaire_id: %s", schedule_type, horaire_id)

0 commit comments

Comments
 (0)