python-selve-new 2.2.0__tar.gz → 2.2.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {python-selve-new-2.2.0 → python-selve-new-2.2.2}/PKG-INFO +1 -1
- {python-selve-new-2.2.0 → python-selve-new-2.2.2}/python_selve_new.egg-info/PKG-INFO +1 -1
- {python-selve-new-2.2.0 → python-selve-new-2.2.2}/selve/__init__.py +447 -87
- {python-selve-new-2.2.0 → python-selve-new-2.2.2}/selve/commands/device.py +4 -0
- {python-selve-new-2.2.0 → python-selve-new-2.2.2}/selve/commands/sender.py +2 -2
- {python-selve-new-2.2.0 → python-selve-new-2.2.2}/selve/commands/sensor.py +4 -0
- {python-selve-new-2.2.0 → python-selve-new-2.2.2}/setup.py +1 -1
- {python-selve-new-2.2.0 → python-selve-new-2.2.2}/LICENSE +0 -0
- {python-selve-new-2.2.0 → python-selve-new-2.2.2}/README.md +0 -0
- {python-selve-new-2.2.0 → python-selve-new-2.2.2}/python_selve_new.egg-info/SOURCES.txt +0 -0
- {python-selve-new-2.2.0 → python-selve-new-2.2.2}/python_selve_new.egg-info/dependency_links.txt +0 -0
- {python-selve-new-2.2.0 → python-selve-new-2.2.2}/python_selve_new.egg-info/requires.txt +0 -0
- {python-selve-new-2.2.0 → python-selve-new-2.2.2}/python_selve_new.egg-info/top_level.txt +0 -0
- {python-selve-new-2.2.0 → python-selve-new-2.2.2}/selve/commands/__init__.py +0 -0
- {python-selve-new-2.2.0 → python-selve-new-2.2.2}/selve/commands/command.py +0 -0
- {python-selve-new-2.2.0 → python-selve-new-2.2.2}/selve/commands/event.py +0 -0
- {python-selve-new-2.2.0 → python-selve-new-2.2.2}/selve/commands/group.py +0 -0
- {python-selve-new-2.2.0 → python-selve-new-2.2.2}/selve/commands/iveo.py +0 -0
- {python-selve-new-2.2.0 → python-selve-new-2.2.2}/selve/commands/param.py +0 -0
- {python-selve-new-2.2.0 → python-selve-new-2.2.2}/selve/commands/senSim.py +0 -0
- {python-selve-new-2.2.0 → python-selve-new-2.2.2}/selve/commands/service.py +0 -0
- {python-selve-new-2.2.0 → python-selve-new-2.2.2}/selve/device.py +0 -0
- {python-selve-new-2.2.0 → python-selve-new-2.2.2}/selve/gateway.py +0 -0
- {python-selve-new-2.2.0 → python-selve-new-2.2.2}/selve/group.py +0 -0
- {python-selve-new-2.2.0 → python-selve-new-2.2.2}/selve/iveo.py +0 -0
- {python-selve-new-2.2.0 → python-selve-new-2.2.2}/selve/senSim.py +0 -0
- {python-selve-new-2.2.0 → python-selve-new-2.2.2}/selve/sender.py +0 -0
- {python-selve-new-2.2.0 → python-selve-new-2.2.2}/selve/sensor.py +0 -0
- {python-selve-new-2.2.0 → python-selve-new-2.2.2}/selve/util/__init__.py +0 -0
- {python-selve-new-2.2.0 → python-selve-new-2.2.2}/selve/util/errors.py +0 -0
- {python-selve-new-2.2.0 → python-selve-new-2.2.2}/selve/util/protocol.py +0 -0
- {python-selve-new-2.2.0 → python-selve-new-2.2.2}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: python-selve-new
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.2
|
|
4
4
|
Summary: Python library for interfacing with selve devices using the USB-RF controller. Written completely new.
|
|
5
5
|
Home-page: https://github.com/Kannix2005/python-selve-new
|
|
6
6
|
Author: Stefan Altheimer
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: python-selve-new
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.2
|
|
4
4
|
Summary: Python library for interfacing with selve devices using the USB-RF controller. Written completely new.
|
|
5
5
|
Home-page: https://github.com/Kannix2005/python-selve-new
|
|
6
6
|
Author: Stefan Altheimer
|
|
@@ -12,6 +12,7 @@ from serial.tools import list_ports
|
|
|
12
12
|
import untangle
|
|
13
13
|
|
|
14
14
|
from selve.commands import param, service
|
|
15
|
+
from selve.commands import device
|
|
15
16
|
from selve.commands.device import *
|
|
16
17
|
from selve.commands.command import *
|
|
17
18
|
from selve.commands.event import *
|
|
@@ -318,6 +319,10 @@ class Selve:
|
|
|
318
319
|
self.commandResult(response)
|
|
319
320
|
if isinstance(response, DeviceGetValuesResponse):
|
|
320
321
|
self.updateCommeoDeviceValuesFromResponse(int(response.parameters[1][1]), response)
|
|
322
|
+
if isinstance(response, SenderTeachResultResponse) \
|
|
323
|
+
or isinstance(response, SensorTeachResultResponse)\
|
|
324
|
+
or isinstance(response, DeviceScanResultResponse):
|
|
325
|
+
self.processTeachResponse(response)
|
|
321
326
|
|
|
322
327
|
return response
|
|
323
328
|
|
|
@@ -602,6 +607,7 @@ class Selve:
|
|
|
602
607
|
async def discover(self):
|
|
603
608
|
|
|
604
609
|
await self.stopWorker()
|
|
610
|
+
await self.setEvents(0,0,0,0,0)
|
|
605
611
|
|
|
606
612
|
if await self.gatewayReady():
|
|
607
613
|
iveoIds: IveoGetIdsResponse = await self.executeCommandSyncWithResponse(IveoGetIds())
|
|
@@ -701,6 +707,7 @@ class Selve:
|
|
|
701
707
|
device.sun3Analog = config.sun3Analog
|
|
702
708
|
self.addOrUpdateDevice(device, SelveTypes.SENSIM)
|
|
703
709
|
|
|
710
|
+
await self.setEvents(1,1,1,1,1)
|
|
704
711
|
await self.startWorker()
|
|
705
712
|
self.list_devices()
|
|
706
713
|
|
|
@@ -759,93 +766,32 @@ class Selve:
|
|
|
759
766
|
return i
|
|
760
767
|
i = i + 1
|
|
761
768
|
|
|
762
|
-
async def
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
if hasattr(methodResponse, "parameters"):
|
|
787
|
-
status = ServiceState(int(methodResponse.parameters[0][1]))
|
|
788
|
-
self._LOGGER.debug(f'Gateway state: {status}')
|
|
789
|
-
self.state = status
|
|
790
|
-
return status
|
|
791
|
-
return None
|
|
792
|
-
|
|
793
|
-
async def gatewayReady(self):
|
|
794
|
-
state = await self.gatewayState()
|
|
795
|
-
return state is ServiceState.READY
|
|
796
|
-
|
|
797
|
-
async def getVersionG(self):
|
|
798
|
-
cmd = service.ServiceGetVersion()
|
|
799
|
-
methodResponse = await self.executeCommandSyncWithResponse(cmd)
|
|
800
|
-
return methodResponse
|
|
801
|
-
|
|
802
|
-
async def getGatewayFirmwareVersion(self):
|
|
803
|
-
command = await self.getVersionG()
|
|
804
|
-
if hasattr(command, "version"):
|
|
805
|
-
return command.version
|
|
806
|
-
else:
|
|
807
|
-
return False
|
|
808
|
-
|
|
809
|
-
async def getGatewaySerial(self):
|
|
810
|
-
command = await self.getVersionG()
|
|
811
|
-
if hasattr(command, "serial"):
|
|
812
|
-
return command.serial
|
|
813
|
-
else:
|
|
814
|
-
return False
|
|
815
|
-
|
|
816
|
-
async def getGatewaySpec(self):
|
|
817
|
-
command = await self.getVersionG()
|
|
818
|
-
if hasattr(command, "spec"):
|
|
819
|
-
return command.spec
|
|
820
|
-
else:
|
|
821
|
-
return False
|
|
822
|
-
|
|
823
|
-
def list_devices(self):
|
|
824
|
-
"""[summary]
|
|
825
|
-
Log the list of registered devices
|
|
826
|
-
"""
|
|
827
|
-
for id, val in self.devices.items():
|
|
828
|
-
for ida, device in val.items():
|
|
829
|
-
self._LOGGER.info(str(device))
|
|
830
|
-
|
|
831
|
-
async def resetGateway(self):
|
|
832
|
-
command = service.ServiceReset()
|
|
833
|
-
response: ServiceResetResponse = await self.executeCommandSyncWithResponse(command)
|
|
834
|
-
if response.executed != 1:
|
|
835
|
-
self._LOGGER.info("Error: Gateway could not be reset or loads too long")
|
|
836
|
-
|
|
837
|
-
# time.sleep(2)
|
|
769
|
+
async def processTeachResponse(self, response):
|
|
770
|
+
if isinstance(response, SenderTeachResultResponse):
|
|
771
|
+
if response.senderId == -1:
|
|
772
|
+
self._LOGGER.info("No Senders found yet...")
|
|
773
|
+
else:
|
|
774
|
+
self._LOGGER.info("Sender found: " + str(response.name) + " - " + str(response.senderId))
|
|
775
|
+
self._LOGGER.info("Time left for teaching: " + str(response.timeLeft) + "s")
|
|
776
|
+
self._LOGGER.debug("Current teaching state: " + str(response.teachState.name))
|
|
777
|
+
self._LOGGER.info("Last event: " + str(response.senderEvent.name))
|
|
778
|
+
|
|
779
|
+
if isinstance(response, SensorTeachResultResponse):
|
|
780
|
+
if response.foundId == -1:
|
|
781
|
+
self._LOGGER.info("No Senders found yet...")
|
|
782
|
+
else:
|
|
783
|
+
self._LOGGER.info("Sensor found: " + str(response.foundId))
|
|
784
|
+
self._LOGGER.info("Time left for teaching: " + str(response.timeLeft) + "s")
|
|
785
|
+
self._LOGGER.debug("Current teaching state: " + str(response.teachState.name))
|
|
786
|
+
|
|
787
|
+
if isinstance(response, DeviceScanResultResponse):
|
|
788
|
+
if response.noNewDevices <= 0:
|
|
789
|
+
self._LOGGER.info("No Senders found yet...")
|
|
790
|
+
else:
|
|
791
|
+
self._LOGGER.info("Devices found: " + str(response.foundIds))
|
|
792
|
+
self._LOGGER.debug("Current teaching state: " + str(response.scanState.name))
|
|
838
793
|
|
|
839
|
-
start_time = time.time()
|
|
840
|
-
while await self.gatewayState() != ServiceState.READY:
|
|
841
|
-
if time.time() - start_time >= 10:
|
|
842
|
-
self._LOGGER.info("Error: Gateway could not be reset or loads too long")
|
|
843
|
-
pass
|
|
844
|
-
self._LOGGER.info("Gateway reset")
|
|
845
794
|
|
|
846
|
-
async def setEvents(self, eventDevice = False, eventSensor = False, eventSender = False, eventLogging = False, eventDuty = False):
|
|
847
|
-
command = param.ParamSetEvent(eventDevice, eventSensor, eventSender, eventLogging, eventDuty)
|
|
848
|
-
return await self.executeCommandSyncWithResponse(command)
|
|
849
795
|
|
|
850
796
|
async def processEventResponse(self, response):
|
|
851
797
|
if isinstance(response, CommeoDeviceEventResponse):
|
|
@@ -928,8 +874,213 @@ class Selve:
|
|
|
928
874
|
for callback in self._callbacks:
|
|
929
875
|
callback()
|
|
930
876
|
|
|
931
|
-
##Device functions
|
|
932
877
|
|
|
878
|
+
### Service
|
|
879
|
+
|
|
880
|
+
async def pingGateway(self):
|
|
881
|
+
cmd = ServicePing()
|
|
882
|
+
methodResponse = await self.executeCommandSyncWithResponse(cmd)
|
|
883
|
+
try:
|
|
884
|
+
if hasattr(methodResponse, "name"):
|
|
885
|
+
if methodResponse.name == "selve.GW.service.ping":
|
|
886
|
+
self._LOGGER.debug("Ping back")
|
|
887
|
+
return True
|
|
888
|
+
except:
|
|
889
|
+
self._LOGGER.debug("Error in ping")
|
|
890
|
+
self._LOGGER.debug("No ping")
|
|
891
|
+
return False
|
|
892
|
+
|
|
893
|
+
|
|
894
|
+
async def gatewayState(self):
|
|
895
|
+
cmd = ServiceGetState()
|
|
896
|
+
try:
|
|
897
|
+
methodResponse = await self.executeCommandSyncWithResponse(cmd)
|
|
898
|
+
except GatewayError:
|
|
899
|
+
self._LOGGER.error(str(GatewayError))
|
|
900
|
+
methodResponse = None
|
|
901
|
+
|
|
902
|
+
if hasattr(methodResponse, "name"):
|
|
903
|
+
if methodResponse.name == "selve.GW." + str(CommeoServiceCommand.GETSTATE.value):
|
|
904
|
+
if hasattr(methodResponse, "parameters"):
|
|
905
|
+
status = ServiceState(int(methodResponse.parameters[0][1]))
|
|
906
|
+
self._LOGGER.debug(f'Gateway state: {status}')
|
|
907
|
+
self.state = status
|
|
908
|
+
return status
|
|
909
|
+
return None
|
|
910
|
+
|
|
911
|
+
async def gatewayReady(self):
|
|
912
|
+
state = await self.gatewayState()
|
|
913
|
+
return state is ServiceState.READY
|
|
914
|
+
|
|
915
|
+
async def getVersionG(self):
|
|
916
|
+
cmd = ServiceGetVersion()
|
|
917
|
+
methodResponse = await self.executeCommandSyncWithResponse(cmd)
|
|
918
|
+
return methodResponse
|
|
919
|
+
|
|
920
|
+
async def getGatewayFirmwareVersion(self):
|
|
921
|
+
command = await self.getVersionG()
|
|
922
|
+
if hasattr(command, "version"):
|
|
923
|
+
return command.version
|
|
924
|
+
else:
|
|
925
|
+
return False
|
|
926
|
+
|
|
927
|
+
async def getGatewaySerial(self):
|
|
928
|
+
command = await self.getVersionG()
|
|
929
|
+
if hasattr(command, "serial"):
|
|
930
|
+
return command.serial
|
|
931
|
+
else:
|
|
932
|
+
return False
|
|
933
|
+
|
|
934
|
+
async def getGatewaySpec(self):
|
|
935
|
+
command = await self.getVersionG()
|
|
936
|
+
if hasattr(command, "spec"):
|
|
937
|
+
return command.spec
|
|
938
|
+
else:
|
|
939
|
+
return False
|
|
940
|
+
|
|
941
|
+
def list_devices(self):
|
|
942
|
+
"""[summary]
|
|
943
|
+
Log the list of registered devices
|
|
944
|
+
"""
|
|
945
|
+
for id, val in self.devices.items():
|
|
946
|
+
for ida, device in val.items():
|
|
947
|
+
self._LOGGER.info(str(device))
|
|
948
|
+
|
|
949
|
+
async def resetGateway(self):
|
|
950
|
+
command = ServiceReset()
|
|
951
|
+
response: ServiceResetResponse = await self.executeCommandSyncWithResponse(command)
|
|
952
|
+
if response.executed is not True:
|
|
953
|
+
self._LOGGER.info("Error: Gateway could not be reset or loads too long")
|
|
954
|
+
|
|
955
|
+
# time.sleep(2)
|
|
956
|
+
|
|
957
|
+
start_time = time.time()
|
|
958
|
+
while await self.gatewayState() != ServiceState.READY:
|
|
959
|
+
if time.time() - start_time >= 30:
|
|
960
|
+
self._LOGGER.info("Error: Gateway could not be reset or loads too long")
|
|
961
|
+
pass
|
|
962
|
+
self._LOGGER.info("Gateway reset")
|
|
963
|
+
|
|
964
|
+
async def factoryResetGateway(self):
|
|
965
|
+
command = ServiceFactoryReset()
|
|
966
|
+
response: ServiceFactoryResetResponse = await self.executeCommandSyncWithResponse(command)
|
|
967
|
+
if response.executed is not True:
|
|
968
|
+
self._LOGGER.info("Error: Gateway could not be reset or loads too long")
|
|
969
|
+
|
|
970
|
+
start_time = time.time()
|
|
971
|
+
while await self.gatewayState() != ServiceState.READY:
|
|
972
|
+
if time.time() - start_time >= 60:
|
|
973
|
+
self._LOGGER.info("Error: Gateway could not be reset or loads too long")
|
|
974
|
+
pass
|
|
975
|
+
self._LOGGER.info("Gateway factory reset")
|
|
976
|
+
return response.executed
|
|
977
|
+
|
|
978
|
+
async def setLED(self, state: bool):
|
|
979
|
+
command = ServiceSetLed(state)
|
|
980
|
+
response: ServiceSetLedResponse = await self.executeCommandSyncWithResponse(command)
|
|
981
|
+
return response.executed
|
|
982
|
+
|
|
983
|
+
async def getLED(self):
|
|
984
|
+
command = ServiceGetLed()
|
|
985
|
+
response: ServiceGetLedResponse = await self.executeCommandSyncWithResponse(command)
|
|
986
|
+
return response
|
|
987
|
+
|
|
988
|
+
### Param
|
|
989
|
+
async def setForward(self, state: bool):
|
|
990
|
+
command = ParamSetForward(state)
|
|
991
|
+
response: ParamSetForwardResponse = await self.executeCommandSyncWithResponse(command)
|
|
992
|
+
return response.executed
|
|
993
|
+
|
|
994
|
+
async def getForward(self):
|
|
995
|
+
command = ParamGetForward()
|
|
996
|
+
response: ParamGetForwardResponse = await self.executeCommandSyncWithResponse(command)
|
|
997
|
+
return response
|
|
998
|
+
|
|
999
|
+
async def setEvents(self, eventDevice = False, eventSensor = False, eventSender = False, eventLogging = False, eventDuty = False):
|
|
1000
|
+
command = ParamSetEvent(eventDevice, eventSensor, eventSender, eventLogging, eventDuty)
|
|
1001
|
+
return await self.executeCommandSyncWithResponse(command)
|
|
1002
|
+
|
|
1003
|
+
|
|
1004
|
+
async def getEvents(self):
|
|
1005
|
+
command = ParamGetEvent()
|
|
1006
|
+
response: ParamGetEventResponse = await self.executeCommandSyncWithResponse(command)
|
|
1007
|
+
return response
|
|
1008
|
+
|
|
1009
|
+
|
|
1010
|
+
async def getDuty(self):
|
|
1011
|
+
command = ParamGetDuty()
|
|
1012
|
+
response: ParamGetDutyResponse = await self.executeCommandSyncWithResponse(command)
|
|
1013
|
+
return response
|
|
1014
|
+
|
|
1015
|
+
async def getRF(self):
|
|
1016
|
+
command = ParamGetRf()
|
|
1017
|
+
response: ParamGetRfResponse = await self.executeCommandSyncWithResponse(command)
|
|
1018
|
+
return response
|
|
1019
|
+
|
|
1020
|
+
|
|
1021
|
+
|
|
1022
|
+
##Device functions
|
|
1023
|
+
async def scanStart(self):
|
|
1024
|
+
command = DeviceScanStart()
|
|
1025
|
+
response: DeviceScanStartResponse = await self.executeCommandSyncWithResponse(command)
|
|
1026
|
+
return response.executed
|
|
1027
|
+
|
|
1028
|
+
async def scanStop(self):
|
|
1029
|
+
command = DeviceScanStop()
|
|
1030
|
+
response: DeviceScanStopResponse = await self.executeCommandSyncWithResponse(command)
|
|
1031
|
+
return response.executed
|
|
1032
|
+
|
|
1033
|
+
async def scanResult(self):
|
|
1034
|
+
""" manually polls the scan state, but the states are being reported automatically by the gateway itself"""
|
|
1035
|
+
command = DeviceScanResult()
|
|
1036
|
+
response: DeviceScanResultResponse = await self.executeCommandSyncWithResponse(command)
|
|
1037
|
+
return response
|
|
1038
|
+
|
|
1039
|
+
async def deviceSave(self, id: int):
|
|
1040
|
+
command = DeviceSave(id)
|
|
1041
|
+
response: DeviceSaveResponse = await self.executeCommandSyncWithResponse(command)
|
|
1042
|
+
return response.executed
|
|
1043
|
+
|
|
1044
|
+
async def deviceGetIds(self):
|
|
1045
|
+
command = DeviceGetIds()
|
|
1046
|
+
response: DeviceGetIdsResponse = await self.executeCommandSyncWithResponse(command)
|
|
1047
|
+
return response
|
|
1048
|
+
|
|
1049
|
+
async def deviceGetInfo(self, id: int):
|
|
1050
|
+
command = DeviceGetInfo(id)
|
|
1051
|
+
response: DeviceGetInfoResponse = await self.executeCommandSyncWithResponse(command)
|
|
1052
|
+
return response
|
|
1053
|
+
|
|
1054
|
+
async def deviceGetValues(self, id: int):
|
|
1055
|
+
command = DeviceGetValues(id)
|
|
1056
|
+
response: DeviceGetValuesResponse = await self.executeCommandSyncWithResponse(command)
|
|
1057
|
+
return response
|
|
1058
|
+
|
|
1059
|
+
async def deviceSetFunction(self, id: int, function: DeviceFunctions):
|
|
1060
|
+
command = DeviceSetFunction(id, function)
|
|
1061
|
+
response: DeviceSetFunctionResponse = await self.executeCommandSyncWithResponse(command)
|
|
1062
|
+
return response.executed
|
|
1063
|
+
|
|
1064
|
+
async def deviceSetLabel(self, id: int, label: str):
|
|
1065
|
+
command = DeviceSetLabel(id, label)
|
|
1066
|
+
response: DeviceSetLabelResponse = await self.executeCommandSyncWithResponse(command)
|
|
1067
|
+
return response.executed
|
|
1068
|
+
|
|
1069
|
+
async def deviceSetType(self, id: int, type: DeviceType):
|
|
1070
|
+
command = DeviceSetType(id, type)
|
|
1071
|
+
response: DeviceSetTypeResponse = await self.executeCommandSyncWithResponse(command)
|
|
1072
|
+
return response.executed
|
|
1073
|
+
|
|
1074
|
+
async def deviceDelete(self, id: int):
|
|
1075
|
+
command = DeviceDelete(id)
|
|
1076
|
+
response: DeviceDeleteResponse = await self.executeCommandSyncWithResponse(command)
|
|
1077
|
+
return response.executed
|
|
1078
|
+
|
|
1079
|
+
async def deviceWriteManual(self, id: int, address: int, name: str, config: DeviceType):
|
|
1080
|
+
command = DeviceWriteManual(id, address, name, config)
|
|
1081
|
+
response: DeviceWriteManualResponse = await self.executeCommandSyncWithResponse(command)
|
|
1082
|
+
return response.executed
|
|
1083
|
+
|
|
933
1084
|
async def updateCommeoDeviceValues(self, id: int):
|
|
934
1085
|
response: DeviceGetValuesResponse = await self.executeCommandSyncWithResponse(DeviceGetValues(id))
|
|
935
1086
|
self.updateCommeoDeviceValuesFromResponse(id, response)
|
|
@@ -1041,7 +1192,28 @@ class Selve:
|
|
|
1041
1192
|
self.setDeviceValue(device.id, 50, SelveTypes.IVEO)
|
|
1042
1193
|
self.setDeviceTargetValue(device.id, 50, SelveTypes.IVEO)
|
|
1043
1194
|
|
|
1195
|
+
|
|
1044
1196
|
## Group
|
|
1197
|
+
async def groupRead(self, id: int):
|
|
1198
|
+
command = GroupRead(id)
|
|
1199
|
+
response: GroupReadResponse = await self.executeCommandSyncWithResponse(command)
|
|
1200
|
+
return response
|
|
1201
|
+
|
|
1202
|
+
async def groupWrite(self, id: int, actorIds: dict, name: str):
|
|
1203
|
+
command = GroupWrite(id, actorIds, name)
|
|
1204
|
+
response: GroupWriteResponse = await self.executeCommandSyncWithResponse(command)
|
|
1205
|
+
return response.executed
|
|
1206
|
+
|
|
1207
|
+
async def groupGetIds(self):
|
|
1208
|
+
command = GroupGetIds()
|
|
1209
|
+
response: GroupGetIdsResponse = await self.executeCommandSyncWithResponse(command)
|
|
1210
|
+
return response
|
|
1211
|
+
|
|
1212
|
+
async def groupDelete(self, id: int):
|
|
1213
|
+
command = GroupDelete(id)
|
|
1214
|
+
response: GroupDeleteResponse = await self.executeCommandSyncWithResponse(command)
|
|
1215
|
+
return response.executed
|
|
1216
|
+
|
|
1045
1217
|
async def moveGroupUp(self, group: SelveGroup, type=DeviceCommandType.MANUAL):
|
|
1046
1218
|
await self.executeCommand(CommandDriveUpGroup(group.id, type))
|
|
1047
1219
|
for id in Util.b64_mask_to_list(group.mask):
|
|
@@ -1058,14 +1230,202 @@ class Selve:
|
|
|
1058
1230
|
await self.updateCommeoDeviceValuesAsync(id)
|
|
1059
1231
|
|
|
1060
1232
|
|
|
1233
|
+
### Iveo
|
|
1234
|
+
async def iveoSetRepeater(self, repeaterInstalled: int):
|
|
1235
|
+
"""
|
|
1236
|
+
Sets the repeater level. \n
|
|
1237
|
+
repeaterInstalled: int can be \n
|
|
1238
|
+
0 = no repeater installed\n
|
|
1239
|
+
1 = repeater installed for 1-time forwarding\n
|
|
1240
|
+
2 = multiple repeaters installed for 2-time forwarding
|
|
1241
|
+
"""
|
|
1242
|
+
command = IveoSetRepeater(repeaterInstalled)
|
|
1243
|
+
response: IveoSetRepeaterResponse = await self.executeCommandSyncWithResponse(command)
|
|
1244
|
+
return response.executed
|
|
1245
|
+
|
|
1246
|
+
async def iveoGetRepeater(self):
|
|
1247
|
+
"""
|
|
1248
|
+
Gets the repeater level. \n
|
|
1249
|
+
response.repeaterState: int can be \n
|
|
1250
|
+
0 = no repeater installed\n
|
|
1251
|
+
1 = repeater installed for 1-time forwarding\n
|
|
1252
|
+
2 = multiple repeaters installed for 2-time forwarding
|
|
1253
|
+
"""
|
|
1254
|
+
command = IveoGetRepeater()
|
|
1255
|
+
response: IveoGetRepeaterResponse = await self.executeCommandSyncWithResponse(command)
|
|
1256
|
+
return response
|
|
1257
|
+
|
|
1258
|
+
async def iveoSetLabel(self, id: int, label: str):
|
|
1259
|
+
command = IveoSetLabel(id, label)
|
|
1260
|
+
response: IveoSetLabelResponse = await self.executeCommandSyncWithResponse(command)
|
|
1261
|
+
return response.executed
|
|
1262
|
+
|
|
1263
|
+
async def iveoSetType(self, id: int, activity: int, type: DeviceType):
|
|
1264
|
+
"""
|
|
1265
|
+
Sets the device configuration. \n
|
|
1266
|
+
id: Iveo device id
|
|
1267
|
+
activity: 0 = channel deactivated, 1 = channel active
|
|
1268
|
+
type: DeviceType
|
|
1269
|
+
|
|
1270
|
+
"""
|
|
1271
|
+
command = IveoSetConfig(id, activity, type)
|
|
1272
|
+
response: IveoSetConfigResponse = await self.executeCommandSyncWithResponse(command)
|
|
1273
|
+
return response.executed
|
|
1274
|
+
|
|
1275
|
+
async def iveoGetType(self, id: int):
|
|
1276
|
+
"""
|
|
1277
|
+
Gets the device configuration.
|
|
1278
|
+
|
|
1279
|
+
Params:
|
|
1280
|
+
id: Iveo device id
|
|
1281
|
+
|
|
1282
|
+
Response:
|
|
1283
|
+
name: Name of device
|
|
1284
|
+
activity: 0 = channel deactivated, 1 = channel active
|
|
1285
|
+
type: DeviceType
|
|
1286
|
+
|
|
1287
|
+
"""
|
|
1288
|
+
command = IveoGetConfig(id)
|
|
1289
|
+
response: IveoGetConfigResponse = await self.executeCommandSyncWithResponse(command)
|
|
1290
|
+
return response
|
|
1291
|
+
|
|
1292
|
+
async def iveoGetIds(self):
|
|
1293
|
+
command = IveoGetIds()
|
|
1294
|
+
response: IveoGetIdsResponse = await self.executeCommandSyncWithResponse(command)
|
|
1295
|
+
return response
|
|
1296
|
+
|
|
1297
|
+
async def iveoFactoryReset(self):
|
|
1298
|
+
command = IveoFactory()
|
|
1299
|
+
response: IveoFactoryResponse = await self.executeCommandSyncWithResponse(command)
|
|
1300
|
+
return response.executed
|
|
1301
|
+
|
|
1302
|
+
async def iveoTeach(self):
|
|
1303
|
+
command = IveoTeach()
|
|
1304
|
+
response: IveoTeachResponse = await self.executeCommandSyncWithResponse(command)
|
|
1305
|
+
return response.executed
|
|
1306
|
+
|
|
1307
|
+
async def iveoLearn(self, id: int):
|
|
1308
|
+
command = IveoLearn(id)
|
|
1309
|
+
response: IveoLearnResponse = await self.executeCommandSyncWithResponse(command)
|
|
1310
|
+
return response.executed
|
|
1311
|
+
|
|
1312
|
+
async def iveoCommandManual(self, actorId: int, command: DriveCommandIveo):
|
|
1313
|
+
command = IveoManual(actorId, command)
|
|
1314
|
+
response: IveoManualResponse = await self.executeCommandSyncWithResponse(command)
|
|
1315
|
+
return response.executed
|
|
1316
|
+
|
|
1317
|
+
async def iveoCommandAutomatic(self, actorId: int, command: DriveCommandIveo):
|
|
1318
|
+
command = IveoAutomatic(actorId, command)
|
|
1319
|
+
response: IveoAutomaticResponse = await self.executeCommandSyncWithResponse(command)
|
|
1320
|
+
return response.executed
|
|
1321
|
+
|
|
1322
|
+
|
|
1323
|
+
|
|
1061
1324
|
### Sensor
|
|
1325
|
+
async def sensorTeachStart(self):
|
|
1326
|
+
command = SensorTechStart()
|
|
1327
|
+
response: SensorTeachStartResponse = await self.executeCommandSyncWithResponse(command)
|
|
1328
|
+
return response.executed
|
|
1329
|
+
|
|
1330
|
+
async def sensorTeachStop(self):
|
|
1331
|
+
command = SensorTeachStop()
|
|
1332
|
+
response: SensorTeachStopResponse = await self.executeCommandSyncWithResponse(command)
|
|
1333
|
+
return response.executed
|
|
1334
|
+
|
|
1335
|
+
async def sensorTeachResult(self):
|
|
1336
|
+
""" manually polls the teach result state, but the states are being reported automatically by the gateway itself"""
|
|
1337
|
+
command = SensorTeachResult()
|
|
1338
|
+
response: SensorTeachResultResponse = await self.executeCommandSyncWithResponse(command)
|
|
1339
|
+
return response
|
|
1340
|
+
|
|
1341
|
+
async def sensorGetIds(self):
|
|
1342
|
+
command = SensorGetIds()
|
|
1343
|
+
response: SensorGetIdsResponse = await self.executeCommandSyncWithResponse(command)
|
|
1344
|
+
return response
|
|
1345
|
+
|
|
1346
|
+
async def sensorGetInfo(self, id: int):
|
|
1347
|
+
command = SensorGetInfo(id)
|
|
1348
|
+
response: SensorGetInfoResponse = await self.executeCommandSyncWithResponse(command)
|
|
1349
|
+
return response
|
|
1350
|
+
|
|
1351
|
+
async def sensorGetValues(self, id: int):
|
|
1352
|
+
command = SensorGetValues(id)
|
|
1353
|
+
response: SensorGetValuesResponse = await self.executeCommandSyncWithResponse(command)
|
|
1354
|
+
return response
|
|
1355
|
+
|
|
1356
|
+
async def sensorSetLabel(self, id: int, label: str):
|
|
1357
|
+
command = SensorSetLabel(id, label)
|
|
1358
|
+
response: SensorSetLabelResponse = await self.executeCommandSyncWithResponse(command)
|
|
1359
|
+
return response.executed
|
|
1360
|
+
|
|
1361
|
+
async def sensorDelete(self, id: int):
|
|
1362
|
+
command = SensorDelete(id)
|
|
1363
|
+
response: SensorDeleteResponse = await self.executeCommandSyncWithResponse(command)
|
|
1364
|
+
return response.executed
|
|
1365
|
+
|
|
1366
|
+
async def sensorWriteManual(self, id: int, address: int, name: str):
|
|
1367
|
+
command = SensorWriteManual(id, address, name)
|
|
1368
|
+
response: SensorWriteManualResponse = await self.executeCommandSyncWithResponse(command)
|
|
1369
|
+
return response.executed
|
|
1370
|
+
|
|
1062
1371
|
async def updateSensorValuesAsync(self, id: int):
|
|
1063
1372
|
await self.executeCommand(SensorGetValues(id))
|
|
1064
1373
|
|
|
1065
|
-
|
|
1374
|
+
|
|
1375
|
+
|
|
1376
|
+
### SenSim - ToDo
|
|
1066
1377
|
async def updateSenSimValuesAsync(self, id: int):
|
|
1067
1378
|
await self.executeCommand(SenSimGetValues(id))
|
|
1068
1379
|
|
|
1069
1380
|
### Sender
|
|
1381
|
+
async def senderTeachStart(self):
|
|
1382
|
+
command = SenderTeachStart()
|
|
1383
|
+
response: SenderTeachStartResponse = await self.executeCommandSyncWithResponse(command)
|
|
1384
|
+
return response.executed
|
|
1385
|
+
|
|
1386
|
+
async def senderTeachStop(self):
|
|
1387
|
+
command = SenderTeachStop()
|
|
1388
|
+
response: SenderTeachStopResponse = await self.executeCommandSyncWithResponse(command)
|
|
1389
|
+
return response.executed
|
|
1390
|
+
|
|
1391
|
+
async def senderTeachResult(self):
|
|
1392
|
+
""" manually polls the teach result state, but the states are being reported automatically by the gateway itself"""
|
|
1393
|
+
command = SenderTeachResult()
|
|
1394
|
+
response: SenderTeachResultResponse = await self.executeCommandSyncWithResponse(command)
|
|
1395
|
+
return response
|
|
1396
|
+
|
|
1397
|
+
async def senderGetIds(self):
|
|
1398
|
+
command = SenderGetIds()
|
|
1399
|
+
response: SenderGetIdsResponse = await self.executeCommandSyncWithResponse(command)
|
|
1400
|
+
return response
|
|
1401
|
+
|
|
1402
|
+
async def senderGetInfo(self, id: int):
|
|
1403
|
+
command = SenderGetInfo(id)
|
|
1404
|
+
response: SenderGetInfoResponse = await self.executeCommandSyncWithResponse(command)
|
|
1405
|
+
return response
|
|
1406
|
+
|
|
1407
|
+
async def senderGetValues(self, id: int):
|
|
1408
|
+
command = SenderGetValues(id)
|
|
1409
|
+
response: SenderGetValuesResponse = await self.executeCommandSyncWithResponse(command)
|
|
1410
|
+
return response
|
|
1411
|
+
|
|
1412
|
+
async def senderSetLabel(self, id: int, label: str):
|
|
1413
|
+
command = SenderSetLabel(id, label)
|
|
1414
|
+
response: SenderSetLabelResponse = await self.executeCommandSyncWithResponse(command)
|
|
1415
|
+
return response.executed
|
|
1416
|
+
|
|
1417
|
+
async def senderDelete(self, id: int):
|
|
1418
|
+
command = SenderDelete(id)
|
|
1419
|
+
response: SenderDeleteResponse = await self.executeCommandSyncWithResponse(command)
|
|
1420
|
+
return response.executed
|
|
1421
|
+
|
|
1422
|
+
async def senderWriteManual(self, id: int, address: int, channel: int, resetCount: int, name: str):
|
|
1423
|
+
command = SenderWriteManual(id, address, channel, resetCount, name)
|
|
1424
|
+
response: SenderWriteManualResponse = await self.executeCommandSyncWithResponse(command)
|
|
1425
|
+
return response.executed
|
|
1426
|
+
|
|
1427
|
+
|
|
1428
|
+
|
|
1429
|
+
|
|
1070
1430
|
async def updateSenderValuesAsync(self, id: int):
|
|
1071
1431
|
await self.executeCommand(SenderGetValues(id))
|
|
@@ -10,6 +10,10 @@ class DeviceScanStop(GatewayCommand):
|
|
|
10
10
|
def __init__(self):
|
|
11
11
|
super().__init__(CommeoDeviceCommand.SCANSTOP)
|
|
12
12
|
|
|
13
|
+
class DeviceScanResult(GatewayCommand):
|
|
14
|
+
def __init__(self):
|
|
15
|
+
super().__init__(CommeoDeviceCommand.SCANRESULT)
|
|
16
|
+
|
|
13
17
|
|
|
14
18
|
class DeviceSave(GatewayCommand):
|
|
15
19
|
def __init__(self, id: int):
|
|
@@ -25,8 +25,8 @@ class SenderGetValues(GatewayCommand):
|
|
|
25
25
|
super().__init__(CommeoSenderCommand.GETVALUES, [(ParameterType.INT, id)])
|
|
26
26
|
|
|
27
27
|
class SenderSetLabel(GatewayCommand):
|
|
28
|
-
def __init__(self, id: int):
|
|
29
|
-
super().__init__(CommeoSenderCommand.SETLABEL, [(ParameterType.INT, id)])
|
|
28
|
+
def __init__(self, id: int, name: str):
|
|
29
|
+
super().__init__(CommeoSenderCommand.SETLABEL, [(ParameterType.INT, id), (ParameterType.STRING, name)])
|
|
30
30
|
|
|
31
31
|
class SenderDelete(GatewayCommand):
|
|
32
32
|
def __init__(self, id: int):
|
|
@@ -10,6 +10,10 @@ class SensorTeachStop(GatewayCommand):
|
|
|
10
10
|
def __init__(self):
|
|
11
11
|
super().__init__(CommeoSensorCommand.TEACHSTOP)
|
|
12
12
|
|
|
13
|
+
class SensorTeachResult(GatewayCommand):
|
|
14
|
+
def __init__(self):
|
|
15
|
+
super().__init__(CommeoSensorCommand.TEACHRESULT)
|
|
16
|
+
|
|
13
17
|
|
|
14
18
|
class SensorGetIds(GatewayCommand):
|
|
15
19
|
def __init__(self):
|
|
@@ -15,7 +15,7 @@ with open(path.join(here, 'README.md'), encoding='utf-8') as f:
|
|
|
15
15
|
setup(
|
|
16
16
|
|
|
17
17
|
name='python-selve-new', # Required
|
|
18
|
-
version='2.2.
|
|
18
|
+
version='2.2.2', # Required
|
|
19
19
|
description='Python library for interfacing with selve devices using the USB-RF controller. Written completely new.', # Required
|
|
20
20
|
long_description=long_description, # Optional
|
|
21
21
|
long_description_content_type="text/markdown",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python-selve-new-2.2.0 → python-selve-new-2.2.2}/python_selve_new.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|