Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix for Wakefield City Council custom component support #352

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading