mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Fix situation where 'model' can be None (string) in Overkiz (#64320)
This commit is contained in:
parent
3c7005d4dc
commit
394c6850a3
@ -2,6 +2,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from enum import unique
|
||||
from typing import cast
|
||||
|
||||
from pyoverkiz.enums import OverkizAttribute, OverkizState
|
||||
from pyoverkiz.models import Device
|
||||
@ -59,23 +60,22 @@ class OverkizEntity(CoordinatorEntity):
|
||||
)
|
||||
|
||||
model = (
|
||||
str(
|
||||
self.executor.select_state(
|
||||
OverkizState.CORE_MODEL,
|
||||
OverkizState.CORE_PRODUCT_MODEL_NAME,
|
||||
OverkizState.IO_MODEL,
|
||||
),
|
||||
self.executor.select_state(
|
||||
OverkizState.CORE_MODEL,
|
||||
OverkizState.CORE_PRODUCT_MODEL_NAME,
|
||||
OverkizState.IO_MODEL,
|
||||
)
|
||||
or self.device.widget
|
||||
or self.device.widget.value
|
||||
)
|
||||
|
||||
return DeviceInfo(
|
||||
identifiers={(DOMAIN, self.executor.base_device_url)},
|
||||
name=self.device.label,
|
||||
manufacturer=str(manufacturer),
|
||||
model=model,
|
||||
sw_version=str(
|
||||
self.executor.select_attribute(OverkizAttribute.CORE_FIRMWARE_REVISION)
|
||||
model=str(model),
|
||||
sw_version=cast(
|
||||
str,
|
||||
self.executor.select_attribute(OverkizAttribute.CORE_FIRMWARE_REVISION),
|
||||
),
|
||||
hw_version=self.device.controllable_name,
|
||||
suggested_area=self.coordinator.areas[self.device.place_oid],
|
||||
|
Loading…
x
Reference in New Issue
Block a user