Skip to content

Commit baf223f

Browse files
Merge pull request #17 from DavidBilodeau1/DavidBilodeau1-patch-1
Fixed collectesinfos call
2 parents a2cda7a + 2710358 commit baf223f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

custom_components/saguenay_collection/config_flow.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ def _fetch_streets(city_id, civic_number):
7979
@staticmethod
8080
def _fetch_schedule_ids(street_id):
8181
response = requests.post(
82-
f"{BASE_URL}/collecteinfos",
83-
data={"ide": street_id},
82+
f"{BASE_URL}/collectesinfos",
83+
data={"cle_batiment": street_id},
8484
timeout=15,
8585
)
8686
response.raise_for_status()
@@ -98,7 +98,7 @@ def _get_street_schema(self):
9898
return vol.Schema(
9999
{
100100
vol.Required("street"): vol.In(
101-
{street["id"]: street["value"] for street in self.streets}
101+
{street["id"]: street["toponymie"]["rue_complete_min"] for street in self.streets}
102102
)
103103
}
104104
)

custom_components/saguenay_collection/sensor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def fetch_data():
4343
results = {}
4444
for schedule in self.schedules:
4545
try:
46-
schedule_type = schedule.get("nom", "Unknown").lower()
46+
schedule_type = schedule.get("type_collecte", "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)