hass-core/homeassistant/components/onewire/model.py
epenet c00a5fad8f
Cleanup device registration in Onewire (#58101)
* Add checks for device registry

* Move registry checks to init.py

* Run device registry check on disabled devices

* Empty commit for testing

* Register devices during initialisation

* Adjust tests accordingly

* Add via_device to device info

* Adjust access to device registry

Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-10-22 11:45:40 +02:00

32 lines
645 B
Python

"""Type definitions for 1-Wire integration."""
from __future__ import annotations
from dataclasses import dataclass
from pi1wire import OneWireInterface
from homeassistant.helpers.entity import DeviceInfo
@dataclass
class OWDeviceDescription:
"""OWDeviceDescription device description class."""
device_info: DeviceInfo
@dataclass
class OWDirectDeviceDescription(OWDeviceDescription):
"""SysBus device description class."""
interface: OneWireInterface
@dataclass
class OWServerDeviceDescription(OWDeviceDescription):
"""OWServer device description class."""
family: str
id: str
path: str
type: str