diff --git a/homeassistant/components/smarla/__init__.py b/homeassistant/components/smarla/__init__.py index f711c8698a9..14a728946f3 100644 --- a/homeassistant/components/smarla/__init__.py +++ b/homeassistant/components/smarla/__init__.py @@ -17,7 +17,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: FederwiegeConfigEntry) - connection = Connection(HOST, token_str=entry.data.get(CONF_ACCESS_TOKEN, None)) # Check if token still has access - if not await connection.get_token(): + if not await connection.refresh_token(): raise ConfigEntryAuthFailed("Invalid authentication") federwiege = Federwiege(hass.loop, connection) diff --git a/homeassistant/components/smarla/config_flow.py b/homeassistant/components/smarla/config_flow.py index ec5d136b0c9..64f354b8354 100644 --- a/homeassistant/components/smarla/config_flow.py +++ b/homeassistant/components/smarla/config_flow.py @@ -31,7 +31,7 @@ class SmarlaConfigFlow(ConfigFlow, domain=DOMAIN): errors["base"] = "invalid_token" return (errors, info) - if await conn.get_token(): + if await conn.refresh_token(): info["serial_number"] = conn.token.serialNumber info["token"] = conn.token.get_string() else: diff --git a/homeassistant/components/smarla/manifest.json b/homeassistant/components/smarla/manifest.json index ef006917539..2b3cab39f91 100644 --- a/homeassistant/components/smarla/manifest.json +++ b/homeassistant/components/smarla/manifest.json @@ -8,5 +8,5 @@ "iot_class": "cloud_push", "loggers": ["pysmarlaapi", "pysignalr"], "quality_scale": "bronze", - "requirements": ["pysmarlaapi==0.6.0"] + "requirements": ["pysmarlaapi==0.7.0"] } diff --git a/homeassistant/components/smarla/switch.py b/homeassistant/components/smarla/switch.py index bdddba338c9..d0aa6ab1925 100644 --- a/homeassistant/components/smarla/switch.py +++ b/homeassistant/components/smarla/switch.py @@ -61,7 +61,7 @@ class SmarlaSwitch(SmarlaBaseEntity, SwitchEntity): desc: SmarlaSwitchEntityDescription, ) -> None: """Initialize a Smarla switch.""" - prop = federwiege.get_service(desc.service).get_property(desc.property) + prop = federwiege.get_property(desc.service, desc.property) super().__init__(federwiege, prop) self.entity_description = desc self._attr_unique_id = f"{federwiege.serial_number}-{desc.key}" diff --git a/requirements_all.txt b/requirements_all.txt index 1a1ae983ddc..cf013f1d42c 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -2335,7 +2335,7 @@ pysma==0.7.5 pysmappee==0.2.29 # homeassistant.components.smarla -pysmarlaapi==0.6.0 +pysmarlaapi==0.7.0 # homeassistant.components.smartthings pysmartthings==3.2.2 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index c2fc0327b54..89f274fa538 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -1908,7 +1908,7 @@ pysma==0.7.5 pysmappee==0.2.29 # homeassistant.components.smarla -pysmarlaapi==0.6.0 +pysmarlaapi==0.7.0 # homeassistant.components.smartthings pysmartthings==3.2.2