diff --git a/homeassistant/components/onewire/const.py b/homeassistant/components/onewire/const.py index fc13ad9c3b0..b908d49f975 100644 --- a/homeassistant/components/onewire/const.py +++ b/homeassistant/components/onewire/const.py @@ -4,7 +4,6 @@ from __future__ import annotations from homeassistant.const import Platform CONF_MOUNT_DIR = "mount_dir" -CONF_NAMES = "names" CONF_TYPE_OWSERVER = "OWServer" CONF_TYPE_SYSBUS = "SysBus" diff --git a/homeassistant/components/onewire/sensor.py b/homeassistant/components/onewire/sensor.py index b0451be953b..758752b4183 100644 --- a/homeassistant/components/onewire/sensor.py +++ b/homeassistant/components/onewire/sensor.py @@ -33,7 +33,6 @@ from homeassistant.helpers.entity_platform import AddEntitiesCallback from homeassistant.helpers.typing import StateType from .const import ( - CONF_NAMES, CONF_TYPE_OWSERVER, CONF_TYPE_SYSBUS, DEVICE_KEYS_0_3, @@ -333,10 +332,6 @@ def get_entities( return [] entities: list[SensorEntity] = [] - device_names = {} - if CONF_NAMES in config and isinstance(config[CONF_NAMES], dict): - device_names = config[CONF_NAMES] - conf_type = config[CONF_TYPE] # We have an owserver on a remote(or local) host/port if conf_type == CONF_TYPE_OWSERVER: @@ -375,7 +370,7 @@ def get_entities( device_file = os.path.join( os.path.split(device.path)[0], description.key ) - name = f"{device_names.get(device_id, device_id)} {description.name}" + name = f"{device_id} {description.name}" entities.append( OneWireProxySensor( description=description, @@ -398,7 +393,7 @@ def get_entities( device_info = device.device_info description = SIMPLE_TEMPERATURE_SENSOR_DESCRIPTION device_file = f"/sys/bus/w1/devices/{device_id}/w1_slave" - name = f"{device_names.get(device_id, device_id)} {description.name}" + name = f"{device_id} {description.name}" entities.append( OneWireDirectSensor( description=description, diff --git a/tests/components/onewire/conftest.py b/tests/components/onewire/conftest.py index d951ff17cdf..189baa3e7da 100644 --- a/tests/components/onewire/conftest.py +++ b/tests/components/onewire/conftest.py @@ -6,7 +6,6 @@ import pytest from homeassistant.components.onewire.const import ( CONF_MOUNT_DIR, - CONF_NAMES, CONF_TYPE_OWSERVER, CONF_TYPE_SYSBUS, DEFAULT_SYSBUS_MOUNT_DIR, @@ -37,9 +36,6 @@ def get_config_entry(hass: HomeAssistant) -> ConfigEntry: CONF_TYPE: CONF_TYPE_OWSERVER, CONF_HOST: "1.2.3.4", CONF_PORT: 1234, - CONF_NAMES: { - "10.111111111111": "My DS18B20", - }, }, options={}, entry_id="2", @@ -57,9 +53,6 @@ def get_sysbus_config_entry(hass: HomeAssistant) -> ConfigEntry: data={ CONF_TYPE: CONF_TYPE_SYSBUS, CONF_MOUNT_DIR: DEFAULT_SYSBUS_MOUNT_DIR, - CONF_NAMES: { - "10-111111111111": "My DS18B20", - }, }, unique_id=f"{CONF_TYPE_SYSBUS}:{DEFAULT_SYSBUS_MOUNT_DIR}", options={}, diff --git a/tests/components/onewire/const.py b/tests/components/onewire/const.py index 3eb0ef51742..e255e234f54 100644 --- a/tests/components/onewire/const.py +++ b/tests/components/onewire/const.py @@ -92,7 +92,7 @@ MOCK_OWPROXY_DEVICES = { Platform.SENSOR: [ { ATTR_DEVICE_CLASS: SensorDeviceClass.TEMPERATURE, - ATTR_ENTITY_ID: "sensor.my_ds18b20_temperature", + ATTR_ENTITY_ID: "sensor.10_111111111111_temperature", ATTR_INJECT_READS: b" 25.123", ATTR_STATE: "25.1", ATTR_STATE_CLASS: SensorStateClass.MEASUREMENT, @@ -1045,7 +1045,7 @@ MOCK_SYSBUS_DEVICES = { Platform.SENSOR: [ { ATTR_DEVICE_CLASS: SensorDeviceClass.TEMPERATURE, - ATTR_ENTITY_ID: "sensor.my_ds18b20_temperature", + ATTR_ENTITY_ID: "sensor.10_111111111111_temperature", ATTR_INJECT_READS: 25.123, ATTR_STATE: "25.1", ATTR_STATE_CLASS: SensorStateClass.MEASUREMENT,