Rename onewire entity classes (#135601)
parent
526277da0f
commit
fa96168488
|
@ -122,9 +122,9 @@ async def async_setup_entry(
|
|||
|
||||
def get_entities(
|
||||
onewire_hub: OneWireHub, devices: list[OWDeviceDescription]
|
||||
) -> list[OneWireBinarySensor]:
|
||||
) -> list[OneWireBinarySensorEntity]:
|
||||
"""Get a list of entities."""
|
||||
entities: list[OneWireBinarySensor] = []
|
||||
entities: list[OneWireBinarySensorEntity] = []
|
||||
for device in devices:
|
||||
family = device.family
|
||||
device_id = device.id
|
||||
|
@ -140,7 +140,7 @@ def get_entities(
|
|||
for description in get_sensor_types(device_sub_type)[family]:
|
||||
device_file = os.path.join(os.path.split(device.path)[0], description.key)
|
||||
entities.append(
|
||||
OneWireBinarySensor(
|
||||
OneWireBinarySensorEntity(
|
||||
description=description,
|
||||
device_id=device_id,
|
||||
device_file=device_file,
|
||||
|
@ -152,7 +152,7 @@ def get_entities(
|
|||
return entities
|
||||
|
||||
|
||||
class OneWireBinarySensor(OneWireEntity, BinarySensorEntity):
|
||||
class OneWireBinarySensorEntity(OneWireEntity, BinarySensorEntity):
|
||||
"""Implementation of a 1-Wire binary sensor."""
|
||||
|
||||
entity_description: OneWireBinarySensorEntityDescription
|
||||
|
|
|
@ -388,9 +388,9 @@ def get_entities(
|
|||
onewire_hub: OneWireHub,
|
||||
devices: list[OWDeviceDescription],
|
||||
options: MappingProxyType[str, Any],
|
||||
) -> list[OneWireSensor]:
|
||||
) -> list[OneWireSensorEntity]:
|
||||
"""Get a list of entities."""
|
||||
entities: list[OneWireSensor] = []
|
||||
entities: list[OneWireSensorEntity] = []
|
||||
for device in devices:
|
||||
family = device.family
|
||||
device_type = device.type
|
||||
|
@ -445,7 +445,7 @@ def get_entities(
|
|||
)
|
||||
continue
|
||||
entities.append(
|
||||
OneWireSensor(
|
||||
OneWireSensorEntity(
|
||||
description=description,
|
||||
device_id=device_id,
|
||||
device_file=device_file,
|
||||
|
@ -456,7 +456,7 @@ def get_entities(
|
|||
return entities
|
||||
|
||||
|
||||
class OneWireSensor(OneWireEntity, SensorEntity):
|
||||
class OneWireSensorEntity(OneWireEntity, SensorEntity):
|
||||
"""Implementation of a 1-Wire sensor."""
|
||||
|
||||
entity_description: OneWireSensorEntityDescription
|
||||
|
|
|
@ -182,9 +182,9 @@ async def async_setup_entry(
|
|||
|
||||
def get_entities(
|
||||
onewire_hub: OneWireHub, devices: list[OWDeviceDescription]
|
||||
) -> list[OneWireSwitch]:
|
||||
) -> list[OneWireSwitchEntity]:
|
||||
"""Get a list of entities."""
|
||||
entities: list[OneWireSwitch] = []
|
||||
entities: list[OneWireSwitchEntity] = []
|
||||
|
||||
for device in devices:
|
||||
family = device.family
|
||||
|
@ -204,7 +204,7 @@ def get_entities(
|
|||
for description in get_sensor_types(device_sub_type)[family]:
|
||||
device_file = os.path.join(os.path.split(device.path)[0], description.key)
|
||||
entities.append(
|
||||
OneWireSwitch(
|
||||
OneWireSwitchEntity(
|
||||
description=description,
|
||||
device_id=device_id,
|
||||
device_file=device_file,
|
||||
|
@ -216,7 +216,7 @@ def get_entities(
|
|||
return entities
|
||||
|
||||
|
||||
class OneWireSwitch(OneWireEntity, SwitchEntity):
|
||||
class OneWireSwitchEntity(OneWireEntity, SwitchEntity):
|
||||
"""Implementation of a 1-Wire switch."""
|
||||
|
||||
entity_description: OneWireSwitchEntityDescription
|
||||
|
|
Loading…
Reference in New Issue