Skip to content

Commit

Permalink
ETA_PU: Updated initialisation of Plugin to get_parameter_value logic…
Browse files Browse the repository at this point in the history
…s, as there seems to be a new bug caused by core changes. As results, without using get_parameter_value all input parameters were handled as string in seperate quotes as part of the string
  • Loading branch information
psilo909 committed Feb 9, 2025
1 parent 4500953 commit dd17ce9
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions eta_pu/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,17 +126,16 @@ class ETA_PU(SmartPlugin):
ALLOW_MULTIINSTANCE = False
PLUGIN_VERSION = "1.1.1"

def __init__(self, smarthome, address, port, setpath, setname):
self._sh = smarthome
def __init__(self, sh, *args, **kwargs):
self._cycle = 30
self.logger = logging.getLogger(__name__)
self._uri = dict()
self._error = None
self._objects = dict()
self._request = Request(address, port)
self._request = Request(self.get_parameter_value('address'), self.get_parameter_value('port'))
self._request.timeout = 2
self._setpath = setpath
self._setname = setname
self._setpath = self.get_parameter_value('setpath')
self._setname = self.get_parameter_value('setname')

def run(self):
self.rebuild_set()
Expand Down Expand Up @@ -246,7 +245,7 @@ def update_var_item(self, item, caller=None, source=None, dest=None):
'''
def fetch_xml(self, uri):
url = 'http://{0}:{1}{2}'.format(self._request.address, self._request.port, uri)
xml = self._sh.tools.fetch_url(url, timeout=2)
xml = self.get_sh().tools.fetch_url(url, timeout=2)
try:
return ET.fromstring(xml)
except:
Expand Down

0 comments on commit dd17ce9

Please sign in to comment.