Skip to content

Commit

Permalink
panasonic_ac: Update to use released package pcomfortcloud from pypi
Browse files Browse the repository at this point in the history
  • Loading branch information
msinn committed Dec 31, 2024
1 parent aa82a40 commit 9131e6c
Show file tree
Hide file tree
Showing 13 changed files with 18 additions and 5 deletions.
10 changes: 8 additions & 2 deletions panasonic_ac/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def __init__(self, sh):
# cycle time in seconds, only needed, if hardware/interface needs to be
# polled for value changes by adding a scheduler entry in the run method of this plugin
# (maybe you want to make it a plugin parameter?)
self._cycle = 30
self._cycle = self.get_parameter_value('cycle')

# if you want to use an item to toggle plugin execution, enable the
# definition in plugin.yaml and uncomment the following line
Expand Down Expand Up @@ -150,7 +150,12 @@ def pcc_getdevicestatus(self, index):
device_status = self.session.get_device(id)['parameters']
except Exception as ex:
device_status = {}
self.logger.dbghigh(f"- Status of device (index={index}) cannot be read - Exception {ex}")

import sys
ex_type, ex_value, ex_traceback = sys.exc_info()

self.logger.dbghigh(f"- Status of device (index={index}) cannot be read - Exception {ex} ({type(ex)}), {dir(ex)=}")
self.logger.dbghigh(f" - {ex_value=}")
return device_status


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

# Items updaten
mapping_root = str(index) + mapping_delimiter
Expand Down
7 changes: 7 additions & 0 deletions panasonic_ac/plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ parameters:
de: 'Login Password für die Panasonic Comfort Cloud'
en: 'Login password for the Panasonic comfort cloud'

cycle:
type: int
default: 60
description:
de: 'Poll Cycle'
en: 'Poll Cycle'

item_attributes:
# Definition of item attributes defined by this plugin (enter 'item_attributes: NONE', if section should be empty)

Expand Down
2 changes: 1 addition & 1 deletion panasonic_ac/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
pcomfortcloud
pcomfortcloud>=0.1.0
bs4
Binary file modified panasonic_ac/webif/static/img/plugin_logo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed panasonic_ac/webif/static/img/plugin_logo.jpg.off
Binary file not shown.
4 changes: 2 additions & 2 deletions panasonic_ac/webif/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -385,8 +385,8 @@
<table class="table table-striped table-hover">
<tbody>
<tr>
<td class="py-1"><strong>&nbsp;</strong></td>
<td class="py-1">{{ _(' ') }}</td>
<td class="py-1"><strong>{{ _('Cycle') }}</strong></td>
<td class="py-1">{{ p._cycle }} {{ _('Sek.') }}</td>
<td class="py-1" width="50px"></td>
<td class="py-1"><strong></strong></td>
<td class="py-1">{{ _('') }}</td>
Expand Down

0 comments on commit 9131e6c

Please sign in to comment.