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