diff --git a/TouchPortalAPI/client.py b/TouchPortalAPI/client.py index e7cb3e4..aa209bc 100644 --- a/TouchPortalAPI/client.py +++ b/TouchPortalAPI/client.py @@ -434,6 +434,9 @@ def connectorUpdate(self, connectorId:str, connectorValue:int): Args: `connectorId`: Cannot be longer then 200 characters. + connectorId have syntax that you need to follow https://www.touch-portal.com/api/index.php?section=connectors + Also according to that site It requires you to have prefix "pc_yourPluginId_" + connectorid however This already provide + you the prefix and the pluginId so you just need you take care the rest eg connectorid|setting1=aValue `connectorValue`: Must be an integer between 0-100. """ if not isinstance(connectorId, str): @@ -443,8 +446,8 @@ def connectorUpdate(self, connectorId:str, connectorValue:int): if 0 <= connectorValue <= 100: self.send({ "type": "connectorUpdate", - "connectorId": connectorId, - "value": connectorValue + "connectorId": f"pc_{self.pluginId}_{connectorId}", + "value": str(connectorValue) }) else: raise TypeError(f"connectorValue needs to be between 0-100 not {connectorValue}") diff --git a/setup.py b/setup.py index a9aa61d..a96cd7a 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,8 @@ 'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.9' + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10' ] setup(