1 """Base entity for the BleBox devices integration."""
5 from blebox_uniapi.error
import Error
6 from blebox_uniapi.feature
import Feature
11 from .const
import DOMAIN
13 _LOGGER = logging.getLogger(__name__)
17 """Implements a common class for entities representing a BleBox feature."""
19 def __init__(self, feature: _FeatureT) ->
None:
20 """Initialize a BleBox entity."""
21 self._feature = feature
22 self._attr_name = feature.full_name
23 self._attr_unique_id = feature.unique_id
24 product = feature.product
26 identifiers={(DOMAIN, product.unique_id)},
27 manufacturer=product.brand,
30 sw_version=product.firmware_version,
31 configuration_url=f
"http://{product.address}",
35 """Update the entity state."""
39 _LOGGER.error(
"Updating '%s' failed: %s", self.name, ex)
None __init__(self, _FeatureT feature)