Skip to content

Commit

Permalink
zone: use new parse functions
Browse files Browse the repository at this point in the history
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
  • Loading branch information
Noltari committed Apr 3, 2024
1 parent 5a54b0c commit adccc54
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions aioairzone_cloud/zone.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

from aioairzone_cloud.common import OperationMode

from .common import parse_str
from .const import (
API_AQ_MODE_CONF,
API_MODE,
Expand Down Expand Up @@ -42,8 +43,9 @@ def __init__(self, inst_id: str, ws_id: str, device_data: dict[str, Any]):
self.system_number = int(sub_data[API_SYSTEM_NUMBER])
self.zone_number = int(sub_data[API_ZONE_NUMBER])

if API_NAME in device_data:
self.name = str(device_data[API_NAME])
device_name = parse_str(device_data.get(API_NAME))
if device_name is not None:
self.name = device_name
else:
self.name = f"Zone {self.system_number}:{self.zone_number}"

Expand Down

0 comments on commit adccc54

Please sign in to comment.