2021-12-10 22:36:30 -07:00
|
|
|
import logging
|
|
|
|
from typing import List
|
|
|
|
|
|
|
|
from homeassistant.helpers.entity import Entity
|
|
|
|
from gehomesdk import ErdCode, ErdApplianceType
|
|
|
|
|
|
|
|
from .base import ApplianceApi
|
|
|
|
from ..entities import (
|
|
|
|
GeErdSensor,
|
|
|
|
GeErdBinarySensor,
|
|
|
|
GeErdShutoffPositionSelect,
|
|
|
|
)
|
|
|
|
|
|
|
|
_LOGGER = logging.getLogger(__name__)
|
|
|
|
|
|
|
|
|
|
|
|
class WaterSoftenerApi(ApplianceApi):
|
|
|
|
"""API class for water softener objects"""
|
|
|
|
|
|
|
|
APPLIANCE_TYPE = ErdApplianceType.WATER_SOFTENER
|
|
|
|
|
|
|
|
def get_all_entities(self) -> List[Entity]:
|
|
|
|
base_entities = super().get_all_entities()
|
|
|
|
|
|
|
|
ws_entities = [
|
|
|
|
GeErdBinarySensor(self, ErdCode.WH_FILTER_MANUAL_MODE, icon_on_override="mdi:human", icon_off_override="mdi:robot"),
|
|
|
|
GeErdSensor(self, ErdCode.WH_FILTER_FLOW_RATE),
|
|
|
|
GeErdBinarySensor(self, ErdCode.WH_FILTER_FLOW_ALERT, device_class_override="moisture"),
|
|
|
|
GeErdSensor(self, ErdCode.WH_FILTER_DAY_USAGE),
|
|
|
|
GeErdSensor(self, ErdCode.WH_SOFTENER_ERROR_CODE, icon_override="mdi:alert-circle"),
|
|
|
|
GeErdSensor(self, ErdCode.WH_SOFTENER_LOW_SALT, icon_override="mdi:grain"),
|
|
|
|
GeErdSensor(self, ErdCode.WH_SOFTENER_SHUTOFF_VALVE_STATE, icon_override="mdi:state-machine"),
|
2021-12-11 09:10:26 -07:00
|
|
|
GeErdSensor(self, ErdCode.WH_SOFTENER_SALT_LIFE_REMAINING, icon_override="mdi:wrench-clock"),
|
2021-12-10 22:36:30 -07:00
|
|
|
GeErdShutoffPositionSelect(self, ErdCode.WH_SOFTENER_SHUTOFF_VALVE_CONTROL),
|
|
|
|
]
|
|
|
|
entities = base_entities + ws_entities
|
|
|
|
return entities
|