diff --git a/homeassistant/components/bond/entity.py b/homeassistant/components/bond/entity.py index 6743bc979ec..aa5a7564b3f 100644 --- a/homeassistant/components/bond/entity.py +++ b/homeassistant/components/bond/entity.py @@ -64,6 +64,7 @@ class BondEntity(Entity): ) self._available = False else: + _LOGGER.debug("Device state for %s is:\n%s", self.entity_id, state) if not self._available: _LOGGER.info("Entity %s has come back", self.entity_id) self._available = True diff --git a/homeassistant/components/bond/utils.py b/homeassistant/components/bond/utils.py index a4df306b429..416d5c8eb32 100644 --- a/homeassistant/components/bond/utils.py +++ b/homeassistant/components/bond/utils.py @@ -1,9 +1,11 @@ """Reusable utilities for the Bond component.""" - +import logging from typing import List, Optional from bond_api import Action, Bond +_LOGGER = logging.getLogger(__name__) + class BondDevice: """Helper device class to hold ID and attributes together.""" @@ -14,6 +16,14 @@ class BondDevice: self.props = props self._attrs = attrs + def __repr__(self): + """Return readable representation of a bond device.""" + return { + "device_id": self.device_id, + "props": self.props, + "attrs": self._attrs, + }.__repr__() + @property def name(self) -> str: """Get the name of this device.""" @@ -75,6 +85,8 @@ class BondHub: for device_id in device_ids ] + _LOGGER.debug("Discovered Bond devices: %s", self._devices) + @property def bond_id(self) -> str: """Return unique Bond ID for this hub.""" @@ -97,5 +109,6 @@ class BondHub: @property def is_bridge(self) -> bool: - """Return if the Bond is a Bond Bridge. If False, it means that it is a Smart by Bond product. Assumes that it is if the model is not available.""" + """Return if the Bond is a Bond Bridge.""" + # If False, it means that it is a Smart by Bond product. Assumes that it is if the model is not available. return self._version.get("model", "BD-").startswith("BD-")