INNER CODE UNIT · Python

handle_create_profile

3dg1luk43/ha_washdata · custom_components/ha_washdata/__init__.py:807

        async def handle_create_profile(call: ServiceCall) -> None:
            device_id = _require_str(call.data.get("device_id"), "device_id")
            profile_name = _require_str(call.data.get("profile_name"), "profile_name")
            reference_cycle_id = call.data.get("reference_cycle_id")

            registry = dr.async_get(hass)
            device = registry.async_get(device_id)
            if not device:
                raise ValueError("Device not found")

            entry_id = next(iter(device.config_entries), None)
            if not entry_id:
                raise ValueError("No config entry found for device")
            if entry_id not in hass.data[DOMAIN]:
                raise ValueError("Integration not loaded for this device")

            manager = hass.data[DOMAIN][entry_id]
            try:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…