Block peer certs on supervisor (#66837)

Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
Co-authored-by: Mike Degatano <michael.degatano@gmail.com>
This commit is contained in:
Paulus Schoutsen 2022-02-22 13:59:40 -08:00 committed by GitHub
parent 756e711850
commit 938b64081b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 121 additions and 31 deletions

View file

@ -332,14 +332,14 @@ class ConfigFlow(BaseZwaveJSFlow, config_entries.ConfigFlow, domain=DOMAIN):
self, user_input: dict[str, Any] | None = None
) -> FlowResult:
"""Handle the initial step."""
if is_hassio(self.hass):
if is_hassio():
return await self.async_step_on_supervisor()
return await self.async_step_manual()
async def async_step_usb(self, discovery_info: usb.UsbServiceInfo) -> FlowResult:
"""Handle USB Discovery."""
if not is_hassio(self.hass):
if not is_hassio():
return self.async_abort(reason="discovery_requires_supervisor")
if self._async_current_entries():
return self.async_abort(reason="already_configured")
@ -641,7 +641,7 @@ class OptionsFlowHandler(BaseZwaveJSFlow, config_entries.OptionsFlow):
self, user_input: dict[str, Any] | None = None
) -> FlowResult:
"""Manage the options."""
if is_hassio(self.hass):
if is_hassio():
return await self.async_step_on_supervisor()
return await self.async_step_manual()