Skip to content

Commit

Permalink
Merge pull request #352 from OliverCullimore/fix-wakefield-city-council
Browse files Browse the repository at this point in the history
fix: Fix for Wakefield City Council custom component support
  • Loading branch information
OliverCullimore authored Sep 28, 2023
2 parents a552211 + 7a4c080 commit dbe7c05
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 5 additions & 5 deletions custom_components/uk_bin_collection/config_flow.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import json
import logging

import aiohttp
import homeassistant.helpers.config_validation as cv
import voluptuous as vol
from homeassistant.core import callback
from homeassistant import config_entries

import logging
from homeassistant.core import callback

_LOGGER = logging.getLogger(__name__)

Expand All @@ -31,7 +30,8 @@ async def get_council_schema(self, council=str) -> vol.Schema:
if self.councils_data is None:
self.councils_data = await self.get_councils_json()
council_schema = vol.Schema({})
if "SKIP_GET_URL" not in self.councils_data[council]:
if ("SKIP_GET_URL" not in self.councils_data[council] or
"custom_component_show_url_field" in self.councils_data[council]):
council_schema = council_schema.extend(
{vol.Required("url", default=""): cv.string}
)
Expand Down Expand Up @@ -134,7 +134,7 @@ async def async_step_init(self, user_input=None):
@staticmethod
@callback
def async_get_options_flow(
config_entry,
config_entry,
) -> config_entries.OptionsFlow:
_LOGGER.info(LOG_PREFIX + "Options flow config_entry: %s", config_entry)
"""Get the options flow for this handler."""
Expand Down
4 changes: 3 additions & 1 deletion uk_bin_collection/tests/input.json
Original file line number Diff line number Diff line change
Expand Up @@ -493,10 +493,12 @@
"wiki_name": "Vale of Glamorgan Council"
},
"WakefieldCityCouncil": {
"SKIP_GET_URL": "SKIP_GET_URL",
"url": "https://www.wakefield.gov.uk/where-i-live/?uprn=63035490&a=115%20Elizabeth%20Drive%20Castleford%20WF10%203RR&usrn=41801243&e=445418&n=426091&p=WF10%203RR",
"wiki_name": "Wakefield City Council",
"wiki_command_url_override": "https://www.wakefield.gov.uk/where-i-live/?uprn=XXXXXXXXXXX&a=XXXXXXXXXXX&usrn=XXXXXXXXXXX&e=XXXXXXXXXXX&n=XXXXXXXXXXX&p=XXXXXXXXXXX",
"wiki_note": "Follow the instructions [here](https://www.wakefield.gov.uk/where-i-live/) until you get the page that includes a \"Bin Collections\" section then copy the URL and replace the URL in the command."
"wiki_note": "Follow the instructions [here](https://www.wakefield.gov.uk/where-i-live/) until you get the page that includes a \"Bin Collections\" section then copy the URL and replace the URL in the command.",
"custom_component_show_url_field": true
},
"WarwickDistrictCouncil": {
"url": "https://estates7.warwickdc.gov.uk/PropertyPortal/Property/Recycling/100070263793",
Expand Down

0 comments on commit dbe7c05

Please sign in to comment.