Skip to content
This repository was archived by the owner on Feb 4, 2024. It is now read-only.

Pyhomematic/add/ipw key blind multi #318

Merged
10 changes: 7 additions & 3 deletions pyhomematic/_hm.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,9 @@ def listDevices(self, interface_id):
self.systemcallback('listDevices', interface_id)


if len(self._devices_raw[remote]) > 2:
# return empty list, as appearently the maximum lenght is limited to 8192 bytes (see #318 for details)
if len(self._devices_raw[remote]) > 0:
return []
# return self._devices_raw[remote][:2]
else:
return self._devices_raw[remote]

Expand Down Expand Up @@ -680,8 +680,12 @@ def proxyInit(self):
LOG.debug("ServerThread.proxyInit: init('http://%s:%i', '%s')" %
(callbackip, callbackport, interface_id))
try:
import debugpy
debugpy.breakpoint()
# at least for home ip, init ccu is not working. Read list devices before "init proxy"
if interface_id == "homeassistant-HMIP":
# this fix is only applied for HmIP-RF (port 2010), as other interfaces not always implement the listDevice function
# and do not show this issue
if proxy._remoteport == 2010:
dev_list = proxy.listDevices(interface_id)
self._rpcfunctions.newDevices(interface_id=interface_id, dev_descriptions=dev_list, skip_systemcallback=True)

Expand Down