Actually fix Guardian entity services (#37700)

* Actually fix Guardian entity services

* Bump aioguardian

* Remove upgrade_firmware defaults
pull/37709/head
Aaron Bach 2020-07-09 20:52:13 -06:00 committed by GitHub
parent 82739bac3b
commit 5f36023b9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 17 additions and 33 deletions

View File

@ -4,7 +4,7 @@
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/guardian",
"requirements": [
"aioguardian==1.0.0"
"aioguardian==1.0.1"
],
"ssdp": [],
"zeroconf": [

View File

@ -4,36 +4,31 @@ disable_ap:
fields:
entity_id:
description: The Guardian valve controller to affect.
area_id:
description: The area to affect.
example: switch.guardian_abcde_valve
enable_ap:
description: Enable the device's onboard access point.
fields:
entity_id:
description: The Guardian valve controller to affect.
area_id:
description: The area to affect.
example: switch.guardian_abcde_valve
reboot:
description: Reboot the device.
fields:
entity_id:
description: The Guardian valve controller to affect.
area_id:
description: The area to affect.
example: switch.guardian_abcde_valve
reset_valve_diagnostics:
description: Fully (and irrecoverably) reset all valve diagnostics.
fields:
entity_id:
description: The Guardian valve controller to affect.
area_id:
description: The area to affect.
example: switch.guardian_abcde_valve
upgrade_firmware:
description: Upgrade the device firmware.
fields:
entity_id:
description: The Guardian valve controller to affect.
area_id:
description: The area to affect.
example: switch.guardian_abcde_valve
url:
description: (optional) The URL of the server hosting the firmware file.
example: https://repo.guardiancloud.services/gvc/fw

View File

@ -2,11 +2,6 @@
from typing import Callable, Dict
from aioguardian import Client
from aioguardian.commands.system import (
DEFAULT_FIRMWARE_UPGRADE_FILENAME,
DEFAULT_FIRMWARE_UPGRADE_PORT,
DEFAULT_FIRMWARE_UPGRADE_URL,
)
from aioguardian.errors import GuardianError
import voluptuous as vol
@ -31,16 +26,6 @@ SERVICE_REBOOT = "reboot"
SERVICE_RESET_VALVE_DIAGNOSTICS = "reset_valve_diagnostics"
SERVICE_UPGRADE_FIRMWARE = "upgrade_firmware"
SERVICE_UPGRADE_FIRMWARE_SCHEMA = vol.Schema(
{
vol.Optional(CONF_URL, default=DEFAULT_FIRMWARE_UPGRADE_URL): cv.url,
vol.Optional(CONF_PORT, default=DEFAULT_FIRMWARE_UPGRADE_PORT): cv.port,
vol.Optional(
CONF_FILENAME, default=DEFAULT_FIRMWARE_UPGRADE_FILENAME
): cv.string,
}
)
async def async_setup_entry(
hass: HomeAssistant, entry: ConfigEntry, async_add_entities: Callable
@ -49,13 +34,17 @@ async def async_setup_entry(
platform = entity_platform.current_platform.get()
for service_name, schema, method in [
(SERVICE_DISABLE_AP, None, "async_disable_ap"),
(SERVICE_ENABLE_AP, None, "async_enable_ap"),
(SERVICE_REBOOT, None, "async_reboot"),
(SERVICE_RESET_VALVE_DIAGNOSTICS, None, "async_reset_valve_diagnostics"),
(SERVICE_DISABLE_AP, {}, "async_disable_ap"),
(SERVICE_ENABLE_AP, {}, "async_enable_ap"),
(SERVICE_REBOOT, {}, "async_reboot"),
(SERVICE_RESET_VALVE_DIAGNOSTICS, {}, "async_reset_valve_diagnostics"),
(
SERVICE_UPGRADE_FIRMWARE,
SERVICE_UPGRADE_FIRMWARE_SCHEMA,
{
vol.Optional(CONF_URL): cv.url,
vol.Optional(CONF_PORT): cv.port,
vol.Optional(CONF_FILENAME): cv.string,
},
"async_upgrade_firmware",
),
]:

View File

@ -179,7 +179,7 @@ aiofreepybox==0.0.8
aioftp==0.12.0
# homeassistant.components.guardian
aioguardian==1.0.0
aioguardian==1.0.1
# homeassistant.components.harmony
aioharmony==0.2.5

View File

@ -85,7 +85,7 @@ aioesphomeapi==2.6.1
aiofreepybox==0.0.8
# homeassistant.components.guardian
aioguardian==1.0.0
aioguardian==1.0.1
# homeassistant.components.harmony
aioharmony==0.2.5