Skip to content

Commit

Permalink
add debug logging
Browse files Browse the repository at this point in the history
  • Loading branch information
kongo09 committed Dec 7, 2024
1 parent ceb3948 commit c996bb1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions custom_components/philips_airpurifier_coap/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,14 @@ async def async_setup_entry(
async_add_entities: Callable[[list[Entity], bool], None],
) -> None:
"""Set up the climate platform."""

_LOGGER.debug("Setting up climate platform")
config_entry_data: ConfigEntryData = hass.data[DOMAIN][entry.entry_id]

model = config_entry_data.device_information.model

model_class = model_to_class.get(model)
if model_class:
_LOGGER.debug("Setting up climate platform for model %s", model)
available_heaters = []
available_preset_modes = {}
available_oscillation = {}
Expand All @@ -47,7 +48,7 @@ async def async_setup_entry(
available_heaters.extend(cls_available_heaters)

# Get the available preset modes from the base classes
cls_available_preset_modes = getattr(cls, "AVAILABLE_PRESET_MODES", {})
cls_available_preset_modes = getattr(cls, "AVAILABLE_PRESET_MODES", [])
available_preset_modes.update(cls_available_preset_modes)

# Get the available oscillation from the base classes
Expand All @@ -66,7 +67,7 @@ async def async_setup_entry(
for heater in HEATER_TYPES
if heater in available_heaters
]

_LOGGER.debug("Adding %s heaters", len(heaters))
async_add_entities(heaters, update_before_add=False)

else:
Expand All @@ -89,7 +90,7 @@ def __init__(
available_oscillation: dict[str, dict[str, str]],
) -> None:
"""Initialize the select."""

_LOGGER.debug("Initializing heater %s", heater)
super().__init__(hass, config, config_entry_data)

self._model = config_entry_data.device_information.model
Expand Down

0 comments on commit c996bb1

Please sign in to comment.