Skip to content

Commit

Permalink
Fix non-zone climate init
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewleech committed Mar 17, 2024
1 parent 7b85595 commit 2fea260
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion custom_components/magiqtouch/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
MODE_HEATER_FAN,
CONTROL_MODE_TEMP,
ZONE_TYPE_COMMON,
ZONE_TYPE_NONE,
)

_LOGGER = logging.getLogger("magiqtouch")
Expand Down Expand Up @@ -140,7 +141,7 @@ def name(self):
def unique_id(self) -> str:
"""Return the unique ID for this sensor."""
uid = self.controller.current_state.device
if self.zone:
if self.zone and self.zone != ZONE_TYPE_NONE:
zone_name = self.controller.get_zone_name(self.zone).replace(" ", "-")
uid += f"-zone-{zone_name}"
return uid
Expand Down
4 changes: 2 additions & 2 deletions custom_components/magiqtouch/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from . import MagiQtouchCoordinator
from .magiqtouch import MagiQtouch_Driver

from .const import ZONE_TYPE_NONE
from typing import Callable, List


Expand Down Expand Up @@ -105,7 +105,7 @@ def unique_id(self) -> str:
"""Return the unique ID for this sensor."""
mac = self.controller.current_state.device
zone_label = ""
if self.zone:
if self.zone and self.zone != ZONE_TYPE_NONE:
zone_name = self.controller.get_zone_name(self.zone).replace(" ", "-")
zone_label = f"-zone-{zone_name}"
uid = f"{mac}{zone_label}-sensor-{self.label}"
Expand Down

0 comments on commit 2fea260

Please sign in to comment.