Skip to content

Commit 9131e6c

Browse files
committed
panasonic_ac: Update to use released package pcomfortcloud from pypi
1 parent aa82a40 commit 9131e6c

File tree

13 files changed

+18
-5
lines changed

13 files changed

+18
-5
lines changed

panasonic_ac/__init__.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def __init__(self, sh):
8484
# cycle time in seconds, only needed, if hardware/interface needs to be
8585
# polled for value changes by adding a scheduler entry in the run method of this plugin
8686
# (maybe you want to make it a plugin parameter?)
87-
self._cycle = 30
87+
self._cycle = self.get_parameter_value('cycle')
8888

8989
# if you want to use an item to toggle plugin execution, enable the
9090
# definition in plugin.yaml and uncomment the following line
@@ -150,7 +150,12 @@ def pcc_getdevicestatus(self, index):
150150
device_status = self.session.get_device(id)['parameters']
151151
except Exception as ex:
152152
device_status = {}
153-
self.logger.dbghigh(f"- Status of device (index={index}) cannot be read - Exception {ex}")
153+
154+
import sys
155+
ex_type, ex_value, ex_traceback = sys.exc_info()
156+
157+
self.logger.dbghigh(f"- Status of device (index={index}) cannot be read - Exception {ex} ({type(ex)}), {dir(ex)=}")
158+
self.logger.dbghigh(f" - {ex_value=}")
154159
return device_status
155160

156161

@@ -404,6 +409,7 @@ def poll_device(self):
404409
for idx, device in enumerate(self._devices):
405410
index = idx + 1
406411
self._devices[str(index)]['parameters'] = self.pcc_getdevicestatus(index)
412+
self.logger.dbghigh(f"poll_device: Polling Panasonic Comfort Cloud for device '{self._devices[str(index)]['name']}' - Got parameters={self._devices[str(index)]['parameters']}")
407413

408414
# Items updaten
409415
mapping_root = str(index) + mapping_delimiter
File renamed without changes.
File renamed without changes.
File renamed without changes.

panasonic_ac/packages/pcomfortcloud/authentication.py renamed to panasonic_ac/packages/pcomfortcloud.off/authentication.py

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

panasonic_ac/plugin.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ parameters:
3636
de: 'Login Password für die Panasonic Comfort Cloud'
3737
en: 'Login password for the Panasonic comfort cloud'
3838

39+
cycle:
40+
type: int
41+
default: 60
42+
description:
43+
de: 'Poll Cycle'
44+
en: 'Poll Cycle'
45+
3946
item_attributes:
4047
# Definition of item attributes defined by this plugin (enter 'item_attributes: NONE', if section should be empty)
4148

panasonic_ac/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
pcomfortcloud
1+
pcomfortcloud>=0.1.0
22
bs4

0 commit comments

Comments
 (0)