Skip to content

Commit

Permalink
rollback unique ids
Browse files Browse the repository at this point in the history
  • Loading branch information
kongo09 committed Nov 9, 2024
1 parent 0f69456 commit 62d65a7
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 14 deletions.
3 changes: 1 addition & 2 deletions custom_components/philips_airpurifier_coap/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from homeassistant.const import ATTR_DEVICE_CLASS, CONF_ENTITY_CATEGORY
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity import Entity
from homeassistant.util import slugify

from .config_entry_data import ConfigEntryData
from .const import BINARY_SENSOR_TYPES, DOMAIN, FanAttributes
Expand Down Expand Up @@ -81,7 +80,7 @@ def __init__(

model = config_entry_data.device_information.model
device_id = config_entry_data.device_information.device_id
self._attr_unique_id = f"{slugify(model)}-{slugify(device_id)}-{kind.lower()}"
self._attr_unique_id = f"{model}-{device_id}-{kind.lower()}"

self._attrs: dict[str, Any] = {}
self.kind = kind
Expand Down
3 changes: 1 addition & 2 deletions custom_components/philips_airpurifier_coap/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
from homeassistant.const import ATTR_DEVICE_CLASS, ATTR_ICON, CONF_ENTITY_CATEGORY
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity import Entity
from homeassistant.util import slugify

from .config_entry_data import ConfigEntryData
from .const import (
Expand Down Expand Up @@ -121,7 +120,7 @@ def __init__(

model = config_entry_data.device_information.model
device_id = config_entry_data.device_information.device_id
self._attr_unique_id = f"{slugify(model)}-{slugify(device_id)}-{light.lower()}"
self._attr_unique_id = f"{model}-{device_id}-{light.lower()}"

self._attrs: dict[str, Any] = {}
self.kind = light.partition("#")[0]
Expand Down
3 changes: 1 addition & 2 deletions custom_components/philips_airpurifier_coap/number.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from homeassistant.const import ATTR_DEVICE_CLASS, ATTR_ICON, CONF_ENTITY_CATEGORY
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity import Entity
from homeassistant.util import slugify

from .config_entry_data import ConfigEntryData
from .const import DOMAIN, NUMBER_TYPES, FanAttributes
Expand Down Expand Up @@ -88,7 +87,7 @@ def __init__(

model = config_entry_data.device_information.model
device_id = config_entry_data.device_information.device_id
self._attr_unique_id = f"{slugify(model)}-{slugify(device_id)}-{number.lower()}"
self._attr_unique_id = f"{model}-{device_id}-{number.lower()}"

self._attrs: dict[str, Any] = {}
self.kind = number
Expand Down
3 changes: 1 addition & 2 deletions custom_components/philips_airpurifier_coap/philips.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.device_registry import CONNECTION_NETWORK_MAC, DeviceInfo
from homeassistant.helpers.entity import Entity
from homeassistant.util import slugify
from homeassistant.util.percentage import (
ordered_list_item_to_percentage,
percentage_to_ordered_list_item,
Expand Down Expand Up @@ -139,7 +138,7 @@ def __init__(
)[0]
model = config_entry_data.device_information.model
device_id = config_entry_data.device_information.device_id
self._attr_unique_id = f"{slugify(model)}-{slugify(device_id)}"
self._attr_unique_id = f"{model}-{device_id}"


class PhilipsGenericCoAPFanBase(PhilipsGenericFan):
Expand Down
3 changes: 1 addition & 2 deletions custom_components/philips_airpurifier_coap/select.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from homeassistant.const import ATTR_DEVICE_CLASS, CONF_ENTITY_CATEGORY
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity import Entity
from homeassistant.util import slugify

from .config_entry_data import ConfigEntryData
from .const import DOMAIN, OPTIONS, SELECT_TYPES, FanAttributes
Expand Down Expand Up @@ -90,7 +89,7 @@ def __init__(

model = config_entry_data.device_information.model
device_id = config_entry_data.device_information.device_id
self._attr_unique_id = f"{slugify(model)}-{slugify(device_id)}-{select.lower()}"
self._attr_unique_id = f"{model}-{device_id}-{select.lower()}"

self._attrs: dict[str, Any] = {}
self.kind = select.partition("#")[0]
Expand Down
3 changes: 1 addition & 2 deletions custom_components/philips_airpurifier_coap/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
from homeassistant.exceptions import PlatformNotReady
from homeassistant.helpers.entity import Entity, EntityCategory
from homeassistant.helpers.typing import StateType
from homeassistant.util import slugify

from .config_entry_data import ConfigEntryData
from .const import (
Expand Down Expand Up @@ -123,7 +122,7 @@ def __init__(

model = config_entry_data.device_information.model
device_id = config_entry_data.device_information.device_id
self._attr_unique_id = f"{slugify(model)}-{slugify(device_id)}-{kind.lower()}"
self._attr_unique_id = f"{model}-{device_id}-{kind.lower()}"

self._attrs: dict[str, Any] = {}
self.kind = kind
Expand Down
3 changes: 1 addition & 2 deletions custom_components/philips_airpurifier_coap/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from homeassistant.const import ATTR_DEVICE_CLASS, ATTR_ICON, CONF_ENTITY_CATEGORY
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity import Entity
from homeassistant.util import slugify

from .config_entry_data import ConfigEntryData
from .const import DOMAIN, SWITCH_OFF, SWITCH_ON, SWITCH_TYPES, FanAttributes
Expand Down Expand Up @@ -83,7 +82,7 @@ def __init__(

model = config_entry_data.device_information.model
device_id = config_entry_data.device_information.device_id
self._attr_unique_id = f"{slugify(model)}-{slugify(device_id)}-{switch.lower()}"
self._attr_unique_id = f"{model}-{device_id}-{switch.lower()}"

self._attrs: dict[str, Any] = {}
self.kind = switch
Expand Down

0 comments on commit 62d65a7

Please sign in to comment.