mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
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 <chris@talkingtontech.com> * Update homeassistant/components/bond/light.py Co-authored-by: Chris Talkington <chris@talkingtontech.com> Co-authored-by: Chris Talkington <chris@talkingtontech.com>
This commit is contained in:
parent
b3691d5d90
commit
f34455b6c2
@ -1,4 +1,5 @@
|
|||||||
"""Support for Bond lights."""
|
"""Support for Bond lights."""
|
||||||
|
import logging
|
||||||
from typing import Any, Callable, List, Optional
|
from typing import Any, Callable, List, Optional
|
||||||
|
|
||||||
from bond_api import Action, DeviceType
|
from bond_api import Action, DeviceType
|
||||||
@ -17,6 +18,8 @@ from .const import DOMAIN
|
|||||||
from .entity import BondEntity
|
from .entity import BondEntity
|
||||||
from .utils import BondDevice
|
from .utils import BondDevice
|
||||||
|
|
||||||
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
async def async_setup_entry(
|
async def async_setup_entry(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
@ -96,7 +99,7 @@ class BondFireplace(BondEntity, LightEntity):
|
|||||||
"""Representation of a Bond-controlled fireplace."""
|
"""Representation of a Bond-controlled fireplace."""
|
||||||
|
|
||||||
def __init__(self, hub: BondHub, device: BondDevice):
|
def __init__(self, hub: BondHub, device: BondDevice):
|
||||||
"""Create HA entity representing Bond fan."""
|
"""Create HA entity representing Bond fireplace."""
|
||||||
super().__init__(hub, device)
|
super().__init__(hub, device)
|
||||||
|
|
||||||
self._power: Optional[bool] = None
|
self._power: Optional[bool] = None
|
||||||
@ -119,6 +122,8 @@ class BondFireplace(BondEntity, LightEntity):
|
|||||||
|
|
||||||
async def async_turn_on(self, **kwargs: Any) -> None:
|
async def async_turn_on(self, **kwargs: Any) -> None:
|
||||||
"""Turn the fireplace on."""
|
"""Turn the fireplace on."""
|
||||||
|
_LOGGER.debug("fireplace async_turn_on called with: %s", kwargs)
|
||||||
|
|
||||||
brightness = kwargs.get(ATTR_BRIGHTNESS)
|
brightness = kwargs.get(ATTR_BRIGHTNESS)
|
||||||
if brightness:
|
if brightness:
|
||||||
flame = round((brightness * 100) / 255)
|
flame = round((brightness * 100) / 255)
|
||||||
@ -128,6 +133,8 @@ class BondFireplace(BondEntity, LightEntity):
|
|||||||
|
|
||||||
async def async_turn_off(self, **kwargs: Any) -> None:
|
async def async_turn_off(self, **kwargs: Any) -> None:
|
||||||
"""Turn the fireplace off."""
|
"""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())
|
await self._hub.bond.action(self._device.device_id, Action.turn_off())
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
Loading…
x
Reference in New Issue
Block a user