def setup_platform( hass: HomeAssistant, config: ConfigType, add_entities: AddEntitiesCallback, discovery_info: DiscoveryInfoType | None = None, ) -> None: """Set up the ThinkingCleaner platform.""" if host := config.get(CONF_HOST): devices = [ThinkingCleaner(host, "unknown")]
def setup_platform(hass, config, add_entities, discovery_info=None): """Set up the ThinkingCleaner platform.""" host = config.get(CONF_HOST) if host: devices = [ThinkingCleaner(host, "unknown")] else: discovery = Discovery() devices = discovery.discover() @util.Throttle(MIN_TIME_BETWEEN_SCANS, MIN_TIME_BETWEEN_FORCED_SCANS) def update_devices(): """Update all devices.""" for device_object in devices: device_object.update() dev = [] for device in devices: for type_name in SWITCH_TYPES: dev.append(ThinkingCleanerSwitch(device, type_name, update_devices)) add_entities(dev)
def setup_platform(hass, config, add_entities, discovery_info=None): """Set up the ThinkingCleaner platform.""" host = config.get(CONF_HOST) if host: devices = [ThinkingCleaner(host, "unknown")] else: discovery = Discovery() devices = discovery.discover() @util.Throttle(MIN_TIME_BETWEEN_SCANS, MIN_TIME_BETWEEN_FORCED_SCANS) def update_devices(): """Update all devices.""" for device_object in devices: device_object.update() entities = [ ThinkingCleanerSensor(device, update_devices, description) for device in devices for description in SENSOR_TYPES ] add_entities(entities)
def setup_platform(hass, config, add_entities, discovery_info=None): """Set up the ThinkingCleaner platform.""" if host := config.get(CONF_HOST): devices = [ThinkingCleaner(host, "unknown")]