From f34455b6c24bc21d95749d89c4c65725168e617b Mon Sep 17 00:00:00 2001 From: Eugene Prystupa Date: Mon, 21 Sep 2020 22:38:43 -0400 Subject: [PATCH] Add debug logging to Bond fireplace entity (#40318) * Add logging to Bond fireplace entity for troubleshooting turn off problem * Update homeassistant/components/bond/light.py Co-authored-by: Chris Talkington * Update homeassistant/components/bond/light.py Co-authored-by: Chris Talkington Co-authored-by: Chris Talkington --- homeassistant/components/bond/light.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/bond/light.py b/homeassistant/components/bond/light.py index 7dec44dbb38..af308891a06 100644 --- a/homeassistant/components/bond/light.py +++ b/homeassistant/components/bond/light.py @@ -1,4 +1,5 @@ """Support for Bond lights.""" +import logging from typing import Any, Callable, List, Optional from bond_api import Action, DeviceType @@ -17,6 +18,8 @@ from .const import DOMAIN from .entity import BondEntity from .utils import BondDevice +_LOGGER = logging.getLogger(__name__) + async def async_setup_entry( hass: HomeAssistant, @@ -96,7 +99,7 @@ class BondFireplace(BondEntity, LightEntity): """Representation of a Bond-controlled fireplace.""" def __init__(self, hub: BondHub, device: BondDevice): - """Create HA entity representing Bond fan.""" + """Create HA entity representing Bond fireplace.""" super().__init__(hub, device) self._power: Optional[bool] = None @@ -119,6 +122,8 @@ class BondFireplace(BondEntity, LightEntity): async def async_turn_on(self, **kwargs: Any) -> None: """Turn the fireplace on.""" + _LOGGER.debug("fireplace async_turn_on called with: %s", kwargs) + brightness = kwargs.get(ATTR_BRIGHTNESS) if brightness: flame = round((brightness * 100) / 255) @@ -128,6 +133,8 @@ class BondFireplace(BondEntity, LightEntity): async def async_turn_off(self, **kwargs: Any) -> None: """Turn the fireplace off.""" + _LOGGER.debug("fireplace async_turn_off called with: %s", kwargs) + await self._hub.bond.action(self._device.device_id, Action.turn_off()) @property