48 files
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
"""Const for Midea Lan."""
|
||||
|
||||
from enum import IntEnum
|
||||
from typing import Any, cast
|
||||
|
||||
from homeassistant.const import Platform
|
||||
|
||||
@@ -14,10 +15,19 @@ CONF_SUBTYPE = "subtype"
|
||||
CONF_ACCOUNT = "account"
|
||||
CONF_SERVER = "server"
|
||||
CONF_REFRESH_INTERVAL = "refresh_interval"
|
||||
CONF_MAC = "mac"
|
||||
CONF_SN = "sn"
|
||||
|
||||
EXTRA_SENSOR = [Platform.SENSOR, Platform.BINARY_SENSOR]
|
||||
EXTRA_SWITCH = [Platform.SWITCH, Platform.LOCK, Platform.SELECT, Platform.NUMBER]
|
||||
EXTRA_SWITCH = [
|
||||
Platform.SWITCH,
|
||||
Platform.LOCK,
|
||||
Platform.SELECT,
|
||||
Platform.NUMBER,
|
||||
Platform.TIME,
|
||||
]
|
||||
EXTRA_CONTROL = [
|
||||
Platform.BUTTON,
|
||||
Platform.CLIMATE,
|
||||
Platform.WATER_HEATER,
|
||||
Platform.FAN,
|
||||
@@ -28,6 +38,18 @@ EXTRA_CONTROL = [
|
||||
ALL_PLATFORM = EXTRA_SENSOR + EXTRA_CONTROL
|
||||
|
||||
|
||||
def supports_model(model: object, config: dict[str, Any]) -> bool:
|
||||
"""Return if the entity config applies to the device model.
|
||||
|
||||
Returns
|
||||
-------
|
||||
True if the entity is available for the device model.
|
||||
|
||||
"""
|
||||
models = config.get("models")
|
||||
return not models or str(model) in cast("list[str]", models)
|
||||
|
||||
|
||||
class FanSpeed(IntEnum):
|
||||
"""FanSpeed reference values."""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user