From ed66bc7bce610cb9d1beee659f6b235d7716c825 Mon Sep 17 00:00:00 2001 From: Duco Sebel <74970928+DCSBL@users.noreply.github.com> Date: Mon, 23 Aug 2021 13:32:14 +0200 Subject: [PATCH] Fix switch not working in python 3.8 --- custom_components/homewizard_energy/switch.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/custom_components/homewizard_energy/switch.py b/custom_components/homewizard_energy/switch.py index 012664e..3d978f2 100644 --- a/custom_components/homewizard_energy/switch.py +++ b/custom_components/homewizard_energy/switch.py @@ -1,4 +1,5 @@ """Creates Homewizard Energy switch entities.""" +from __future__ import annotations from typing import Any, Final @@ -33,7 +34,7 @@ Logger = logging.getLogger(__name__) -SWITCHES: Final[list[SwitchEntityDescription]] = [ +SWITCHES: Final[tuple[SwitchEntityDescription, ...]] = ( SwitchEntityDescription( key=ATTR_POWER_ON, name="Switch", device_class=DEVICE_CLASS_OUTLET ), @@ -43,7 +44,8 @@ device_class=DEVICE_CLASS_SWITCH, icon="mdi:lock", ), -] +) + async def async_setup_entry(