Skip to content

Commit

Permalink
Bug Fix for names
Browse files Browse the repository at this point in the history
  • Loading branch information
c503ghosh committed Oct 15, 2024
1 parent 96db9af commit e792a2f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion custom_components/dirigera_platform/base_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ def should_register_with_listener(self):

@property
def device_info(self) -> DeviceInfo:
logger.debug(f"device_info called {self.name}")

return DeviceInfo(
identifiers={("dirigera_platform", self._json_data.id)},
Expand Down Expand Up @@ -115,6 +114,8 @@ def device_info(self) -> DeviceInfo:

@property
def name(self):
if self._name is None or len(self._name) == 0:
return self._device.name
return self._name

@property
Expand Down
8 changes: 4 additions & 4 deletions custom_components/dirigera_platform/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,14 +238,14 @@ def __init__(
name_suffix = " "
if self._pm25_type == WhichPM25.CURRENT:
id_suffix = "CURPM25"
name = "Current PM2.5"
name_suffix = "Current PM2.5"
if self._pm25_type == WhichPM25.MAX:
id_suffix = "MAXPM25"
name = "Max Measured PM2.5"
name_suffix = "Max Measured PM2.5"
if self._pm25_type == WhichPM25.MIN:
id_suffix = "MINPM25"
name = "Min Measured PM2.5"

name_suffix = "Min Measured PM2.5"
super().__init__(device, id_suffix=id_suffix, name=name_suffix)

@property
Expand Down

0 comments on commit e792a2f

Please sign in to comment.