Update bsblan integration (#67399)
* Update bsblan integration Update the integration to current standards * removed unused code update coverage * some cleanup * fix conflicts due upstream changes * fix prettier json files * fix remove comment code * use dataclass instead of tuple * fix spelling * Set as class attribute main entity doesn't need to give own name * fix requirements
This commit is contained in:
parent
c1213857ce
commit
1fe397f7d7
16 changed files with 588 additions and 434 deletions
34
homeassistant/components/bsblan/entity.py
Normal file
34
homeassistant/components/bsblan/entity.py
Normal file
|
@ -0,0 +1,34 @@
|
|||
"""Base entity for the BSBLAN integration."""
|
||||
from __future__ import annotations
|
||||
|
||||
from bsblan import BSBLAN, Device, Info
|
||||
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import CONF_HOST
|
||||
from homeassistant.helpers.device_registry import format_mac
|
||||
from homeassistant.helpers.entity import DeviceInfo, Entity
|
||||
|
||||
from .const import DOMAIN
|
||||
|
||||
|
||||
class BSBLANEntity(Entity):
|
||||
"""Defines a BSBLAN entity."""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
client: BSBLAN,
|
||||
device: Device,
|
||||
info: Info,
|
||||
entry: ConfigEntry,
|
||||
) -> None:
|
||||
"""Initialize an BSBLAN entity."""
|
||||
self.client = client
|
||||
|
||||
self._attr_device_info = DeviceInfo(
|
||||
identifiers={(DOMAIN, format_mac(device.MAC))},
|
||||
manufacturer="BSBLAN Inc.",
|
||||
model=info.device_identification.value,
|
||||
name=device.name,
|
||||
sw_version=f"{device.version})",
|
||||
configuration_url=f"http://{entry.data[CONF_HOST]}",
|
||||
)
|
Loading…
Add table
Add a link
Reference in a new issue