Skip to content

Commit

Permalink
Fix push_feature
Browse files Browse the repository at this point in the history
  • Loading branch information
albertogeniola committed Oct 1, 2023
1 parent 324591c commit 36af896
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
2 changes: 1 addition & 1 deletion elmax_api/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Client for the Elmax Cloud services."""

__name__ = "elmax_api"
__version__ = "0.0.5rc2"
__version__ = "0.0.5rc3"
__license__ = "MIT"
__url__ = "https://github.com/albertogeniola/elmax-api"
__author__ = "Alberto Geniola"
Expand Down
28 changes: 26 additions & 2 deletions elmax_api/model/panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,13 @@ def __init__(self,
areas: List[Area],
groups: List[Group],
scenes: List[Scene],
covers: List[Cover]):
covers: List[Cover],
push_feature: bool,
accessory_type: str,
accessory_release: str,
*args,
**kwargs
):

self._panel_id = panel_id
self._user_email = user_email
Expand All @@ -82,6 +88,9 @@ def __init__(self,
self._groups = groups
self._scenes = scenes
self._covers = covers
self._push_feature = push_feature
self._accessory_type = accessory_type
self._accessory_release = accessory_release

@property
def panel_id(self) -> str:
Expand Down Expand Up @@ -138,6 +147,18 @@ def all_endpoints(self) -> List[DeviceEndpoint]:
res.extend(self.covers)
return res

@property
def push_feature(self) -> bool:
return self._push_feature

@property
def accessory_type(self) -> str:
return self._accessory_type

@property
def accessory_release(self) -> str:
return self._accessory_release

def __repr__(self):
def inspectobj(obj):
if isinstance(obj,Enum):
Expand All @@ -158,6 +179,9 @@ def from_api_response(response_entry: Dict) -> 'PanelStatus':
release=response_entry.get('release'),
cover_feature=response_entry.get('tappFeature'),
scene_feature=response_entry.get('sceneFeature'),
push_feature=response_entry.get('pushFeature', False),
accessory_type=response_entry.get('tipo_accessorio', 'Unknown'),
accessory_release=response_entry.get('release_accessorio', 'Unknown'),
zones=[Zone.from_api_response(x) for x in response_entry.get('zone', [])],
actuators=[Actuator.from_api_response(x) for x in response_entry.get('uscite', [])],
areas=[Area.from_api_response(x) for x in response_entry.get('aree', [])],
Expand Down Expand Up @@ -246,7 +270,7 @@ def all_endpoints(self) -> List[DeviceEndpoint]:
return res

@property
def supports_push_feature(self) -> bool:
def push_feature(self) -> bool:
return self._push_feature

@property
Expand Down

0 comments on commit 36af896

Please sign in to comment.