Upgrade adguardhome to v0.5.0 (#47774)

This commit is contained in:
Franck Nijhof 2021-03-12 00:37:34 +01:00 committed by GitHub
parent daab9f9810
commit 66605b5994
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 13 additions and 9 deletions

View file

@ -81,24 +81,28 @@ async def async_setup_entry(hass: HomeAssistantType, entry: ConfigEntry) -> bool
async def add_url(call) -> None:
"""Service call to add a new filter subscription to AdGuard Home."""
await adguard.filtering.add_url(
call.data.get(CONF_NAME), call.data.get(CONF_URL)
allowlist=False, name=call.data.get(CONF_NAME), url=call.data.get(CONF_URL)
)
async def remove_url(call) -> None:
"""Service call to remove a filter subscription from AdGuard Home."""
await adguard.filtering.remove_url(call.data.get(CONF_URL))
await adguard.filtering.remove_url(allowlist=False, url=call.data.get(CONF_URL))
async def enable_url(call) -> None:
"""Service call to enable a filter subscription in AdGuard Home."""
await adguard.filtering.enable_url(call.data.get(CONF_URL))
await adguard.filtering.enable_url(allowlist=False, url=call.data.get(CONF_URL))
async def disable_url(call) -> None:
"""Service call to disable a filter subscription in AdGuard Home."""
await adguard.filtering.disable_url(call.data.get(CONF_URL))
await adguard.filtering.disable_url(
allowlist=False, url=call.data.get(CONF_URL)
)
async def refresh(call) -> None:
"""Service call to refresh the filter subscriptions in AdGuard Home."""
await adguard.filtering.refresh(call.data.get(CONF_FORCE))
await adguard.filtering.refresh(
allowlist=False, force=call.data.get(CONF_FORCE)
)
hass.services.async_register(
DOMAIN, SERVICE_ADD_URL, add_url, schema=SERVICE_ADD_URL_SCHEMA

View file

@ -3,6 +3,6 @@
"name": "AdGuard Home",
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/adguard",
"requirements": ["adguardhome==0.4.2"],
"requirements": ["adguardhome==0.5.0"],
"codeowners": ["@frenck"]
}

View file

@ -232,4 +232,4 @@ class AdGuardHomeRulesCountSensor(AdGuardHomeSensor):
async def _adguard_update(self) -> None:
"""Update AdGuard Home entity."""
self._state = await self.adguard.filtering.rules_count()
self._state = await self.adguard.filtering.rules_count(allowlist=False)

View file

@ -111,7 +111,7 @@ adb-shell[async]==0.2.1
adext==0.4.1
# homeassistant.components.adguard
adguardhome==0.4.2
adguardhome==0.5.0
# homeassistant.components.advantage_air
advantage_air==0.2.1

View file

@ -51,7 +51,7 @@ adb-shell[async]==0.2.1
adext==0.4.1
# homeassistant.components.adguard
adguardhome==0.4.2
adguardhome==0.5.0
# homeassistant.components.advantage_air
advantage_air==0.2.1