Disable zone bypass switch feature (#66243)

* Add configuration option to disable the creation of zone bypass switches

* Removed temporary workaround and bumped pyenvisalink version to pick up the correct fix.

* Remove zone bypass configuration option and disable zone bypass switches per code review instructions.
This commit is contained in:
ufodone 2022-02-11 02:38:50 -08:00 committed by GitHub
parent 335a918118
commit 49a41ebe14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 17 deletions

View File

@ -262,6 +262,7 @@ tests/components/enphase_envoy/* @gtdiehl
homeassistant/components/entur_public_transport/* @hfurubotten homeassistant/components/entur_public_transport/* @hfurubotten
homeassistant/components/environment_canada/* @gwww @michaeldavie homeassistant/components/environment_canada/* @gwww @michaeldavie
tests/components/environment_canada/* @gwww @michaeldavie tests/components/environment_canada/* @gwww @michaeldavie
homeassistant/components/envisalink/* @ufodone
homeassistant/components/ephember/* @ttroy50 homeassistant/components/ephember/* @ttroy50
homeassistant/components/epson/* @pszafer homeassistant/components/epson/* @pszafer
tests/components/epson/* @pszafer tests/components/epson/* @pszafer

View File

@ -137,6 +137,7 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
keep_alive, keep_alive,
hass.loop, hass.loop,
connection_timeout, connection_timeout,
False,
) )
hass.data[DATA_EVL] = controller hass.data[DATA_EVL] = controller
@ -181,12 +182,6 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
_LOGGER.debug("The envisalink sent a partition update event") _LOGGER.debug("The envisalink sent a partition update event")
async_dispatcher_send(hass, SIGNAL_PARTITION_UPDATE, data) async_dispatcher_send(hass, SIGNAL_PARTITION_UPDATE, data)
@callback
def async_zone_bypass_update(data):
"""Handle zone bypass status updates."""
_LOGGER.debug("Envisalink sent a zone bypass update event. Updating zones")
async_dispatcher_send(hass, SIGNAL_ZONE_BYPASS_UPDATE, data)
@callback @callback
def stop_envisalink(event): def stop_envisalink(event):
"""Shutdown envisalink connection and thread on exit.""" """Shutdown envisalink connection and thread on exit."""
@ -206,7 +201,6 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
controller.callback_login_failure = async_login_fail_callback controller.callback_login_failure = async_login_fail_callback
controller.callback_login_timeout = async_connection_fail_callback controller.callback_login_timeout = async_connection_fail_callback
controller.callback_login_success = async_connection_success_callback controller.callback_login_success = async_connection_success_callback
controller.callback_zone_bypass_update = async_zone_bypass_update
_LOGGER.info("Start envisalink") _LOGGER.info("Start envisalink")
controller.start() controller.start()
@ -240,13 +234,9 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
hass, Platform.BINARY_SENSOR, "envisalink", {CONF_ZONES: zones}, config hass, Platform.BINARY_SENSOR, "envisalink", {CONF_ZONES: zones}, config
) )
) )
# Only DSC panels support getting zone bypass status
if panel_type == PANEL_TYPE_DSC: # Zone bypass switches are not currently created due to an issue with some panels.
hass.async_create_task( # These switches will be re-added in the future after some further refactoring of the integration.
async_load_platform(
hass, "switch", "envisalink", {CONF_ZONES: zones}, config
)
)
hass.services.async_register( hass.services.async_register(
DOMAIN, SERVICE_CUSTOM_FUNCTION, handle_custom_function, schema=SERVICE_SCHEMA DOMAIN, SERVICE_CUSTOM_FUNCTION, handle_custom_function, schema=SERVICE_SCHEMA

View File

@ -2,8 +2,8 @@
"domain": "envisalink", "domain": "envisalink",
"name": "Envisalink", "name": "Envisalink",
"documentation": "https://www.home-assistant.io/integrations/envisalink", "documentation": "https://www.home-assistant.io/integrations/envisalink",
"requirements": ["pyenvisalink==4.3"], "requirements": ["pyenvisalink==4.4"],
"codeowners": [], "codeowners": ["@ufodone"],
"iot_class": "local_push", "iot_class": "local_push",
"loggers": ["pyenvisalink"] "loggers": ["pyenvisalink"]
} }

View File

@ -1503,7 +1503,7 @@ pyeight==0.2.0
pyemby==1.8 pyemby==1.8
# homeassistant.components.envisalink # homeassistant.components.envisalink
pyenvisalink==4.3 pyenvisalink==4.4
# homeassistant.components.ephember # homeassistant.components.ephember
pyephember==0.3.1 pyephember==0.3.1