Thanks this is working for a while…
Regards,
Regulvar
@Regulvar
Best posts made by Regulvar
Latest posts made by Regulvar
-
RE: Relay Command with Python
-
RE: Relay Command with Python
Hi
I'm trying to command a relay with python using the jsonrpclib, my relay is worked well but I have an error.
Can you help me?from jsonrpclib import Server s=Server("http://IPAdressUnipi/rpc") relay1=s.relay_get(1) print relay1[0] value=int(1-relay1[0]) print value if value: s.relay_set(1,1) else: s.relay_set(1,0)
Traceback (most recent call last):
File "unipi.py", line 12, in <module>
s.relay_set(1,1)
File "/usr/local/lib/python2.7/dist-packages/jsonrpclib/jsonrpc.py", line 288, in call
return self.__send(self.__name, args)
File "/usr/local/lib/python2.7/dist-packages/jsonrpclib/jsonrpc.py", line 239, in _request
return response['result']
TypeError: 'NoneType' object has no attribute 'getitem' -
Relay Command with Python
Hi
I'm trying to command a relay with python using the jsonrpclib, my relay is worked well but I have an error.
Can you help me?from jsonrpclib import Server s=Server("http://IPAdressUnipi/rpc") relay1=s.relay_get(1) print relay1[0] value=int(1-relay1[0]) print value if value: s.relay_set(1,1) else: s.relay_set(1,0)
Traceback (most recent call last):
File "unipi.py", line 12, in <module>
s.relay_set(1,1)
File "/usr/local/lib/python2.7/dist-packages/jsonrpclib/jsonrpc.py", line 288, in call
return self.__send(self.__name, args)
File "/usr/local/lib/python2.7/dist-packages/jsonrpclib/jsonrpc.py", line 239, in _request
return response['result']
TypeError: 'NoneType' object has no attribute 'getitem'