From fa961684882aabeddeb9aaa3b799b97864588926 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Tue, 14 Jan 2025 15:44:18 +0100 Subject: [PATCH] Rename onewire entity classes (#135601) --- homeassistant/components/onewire/binary_sensor.py | 8 ++++---- homeassistant/components/onewire/sensor.py | 8 ++++---- homeassistant/components/onewire/switch.py | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/homeassistant/components/onewire/binary_sensor.py b/homeassistant/components/onewire/binary_sensor.py index 7a8f81eec0e..60a1d165b15 100644 --- a/homeassistant/components/onewire/binary_sensor.py +++ b/homeassistant/components/onewire/binary_sensor.py @@ -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 diff --git a/homeassistant/components/onewire/sensor.py b/homeassistant/components/onewire/sensor.py index ae6a3642c58..1c4047abf0a 100644 --- a/homeassistant/components/onewire/sensor.py +++ b/homeassistant/components/onewire/sensor.py @@ -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 diff --git a/homeassistant/components/onewire/switch.py b/homeassistant/components/onewire/switch.py index 0df2ba0dd57..7215b1ec020 100644 --- a/homeassistant/components/onewire/switch.py +++ b/homeassistant/components/onewire/switch.py @@ -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