from homeassistant.const import Platform, UnitOfTemperature, PRECISION_HALVES, UnitOfTime, UnitOfElectricPotential, \ UnitOfVolume, UnitOfMass from homeassistant.components.sensor import SensorStateClass, SensorDeviceClass from homeassistant.components.binary_sensor import BinarySensorDeviceClass from homeassistant.components.switch import SwitchDeviceClass DEVICE_MAPPING = { "default": { "rationale": ["off", "on"], "queries": [{}], "centralized": [], "entities": { Platform.SWITCH: { "power": { "device_class": SwitchDeviceClass.SWITCH, }, "heat_start": { "device_class": SwitchDeviceClass.SWITCH, "rationale": [0, 1], }, "lock": { "device_class": SwitchDeviceClass.SWITCH, }, "sleep": { "device_class": SwitchDeviceClass.SWITCH, }, "keep_warm": { "device_class": SwitchDeviceClass.SWITCH, }, "vacation": { "device_class": SwitchDeviceClass.SWITCH, }, "germicidal": { "device_class": SwitchDeviceClass.SWITCH, }, "lack_water": { "device_class": SwitchDeviceClass.SWITCH, }, "drainage": { "device_class": SwitchDeviceClass.SWITCH, }, "wash_enable": { "device_class": SwitchDeviceClass.SWITCH, }, }, Platform.BINARY_SENSOR: { "heat_status": { "device_class": BinarySensorDeviceClass.RUNNING, }, "standby_status": { "device_class": BinarySensorDeviceClass.RUNNING, }, "chlorine_sterilization_error": { "device_class": BinarySensorDeviceClass.PROBLEM, }, "rtc_error": { "device_class": BinarySensorDeviceClass.PROBLEM, } }, Platform.SENSOR: { "current_temperature": { "device_class": SensorDeviceClass.TEMPERATURE, "unit_of_measurement": UnitOfTemperature.CELSIUS, "state_class": SensorStateClass.MEASUREMENT }, "cool_target_temperature": { "device_class": SensorDeviceClass.TEMPERATURE, "unit_of_measurement": UnitOfTemperature.CELSIUS, "state_class": SensorStateClass.MEASUREMENT }, "water_consumption_ml": { "device_class": SensorDeviceClass.VOLUME, "unit_of_measurement": UnitOfVolume.LITERS, "state_class": SensorStateClass.TOTAL_INCREASING }, "keep_warm_time": { "device_class": SensorDeviceClass.DURATION, "unit_of_measurement": UnitOfTime.MINUTES, "state_class": SensorStateClass.MEASUREMENT }, "warm_left_time": { "device_class": SensorDeviceClass.DURATION, "unit_of_measurement": UnitOfTime.MINUTES, "state_class": SensorStateClass.MEASUREMENT }, } } } }