Actually fix Guardian entity services (#37700)

* Actually fix Guardian entity services

* Bump aioguardian

* Remove upgrade_firmware defaults
This commit is contained in:
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, "config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/guardian", "documentation": "https://www.home-assistant.io/integrations/guardian",
"requirements": [ "requirements": [
"aioguardian==1.0.0" "aioguardian==1.0.1"
], ],
"ssdp": [], "ssdp": [],
"zeroconf": [ "zeroconf": [

View File

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

View File

@ -2,11 +2,6 @@
from typing import Callable, Dict from typing import Callable, Dict
from aioguardian import Client 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 from aioguardian.errors import GuardianError
import voluptuous as vol import voluptuous as vol
@ -31,16 +26,6 @@ SERVICE_REBOOT = "reboot"
SERVICE_RESET_VALVE_DIAGNOSTICS = "reset_valve_diagnostics" SERVICE_RESET_VALVE_DIAGNOSTICS = "reset_valve_diagnostics"
SERVICE_UPGRADE_FIRMWARE = "upgrade_firmware" 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( async def async_setup_entry(
hass: HomeAssistant, entry: ConfigEntry, async_add_entities: Callable hass: HomeAssistant, entry: ConfigEntry, async_add_entities: Callable
@ -49,13 +34,17 @@ async def async_setup_entry(
platform = entity_platform.current_platform.get() platform = entity_platform.current_platform.get()
for service_name, schema, method in [ for service_name, schema, method in [
(SERVICE_DISABLE_AP, None, "async_disable_ap"), (SERVICE_DISABLE_AP, {}, "async_disable_ap"),
(SERVICE_ENABLE_AP, None, "async_enable_ap"), (SERVICE_ENABLE_AP, {}, "async_enable_ap"),
(SERVICE_REBOOT, None, "async_reboot"), (SERVICE_REBOOT, {}, "async_reboot"),
(SERVICE_RESET_VALVE_DIAGNOSTICS, None, "async_reset_valve_diagnostics"), (SERVICE_RESET_VALVE_DIAGNOSTICS, {}, "async_reset_valve_diagnostics"),
( (
SERVICE_UPGRADE_FIRMWARE, 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", "async_upgrade_firmware",
), ),
]: ]:

View File

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

View File

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