Closed MFlasskamp closed 8 years ago
pmatic ships with a code that is meant to detect whether or not the pmatic script is being executed on the CCU or another system. In case it is executed on the CCU, it should simply ignore the provided address and login credentials and simply connect to the local CCU APIs.
I realized it this way to make it possible to execute remotely developed pmatic scripts on the CCU without removing the credentials etc.
So in theory, and on my CCU2,
ccu = pmatic.CCU()
equals to
ccu = pmatic.CCU(address="http://192.168.1.26", credentials=("Admin", "EPIC-SECRET-PW"))
when executed on the CCU.
The CCU detection is based on the uname output of the system. Could you please send me the output of this command executed on your CCU:
python -c 'import os ; print(os.uname())'
I could not imagine that it would be different for the CCUs. Maybe the detection needs to be adapted a bit.
Maybe because of the new firmware 2.17.4?
# python -c 'import os ; print(os.uname())'
('Linux', 'ccu2', '3.4.11.ccu2', '#1 PREEMPT Wed Dec 16 09:23:30 CET 2015', 'armv5tejl')
(related: os.uname()
does not work with Windows. An alternative would be platform.uname()
but requires the platform module)
Oh, got it. My fault. I thought the 2nd element was a generic name, but it is the local hostname, which is ccu2 for your device and ccu for mine. So the detection failed. Changed it now to use the suffix of the 3rd field.
Related to the Windows thing: I am currently unsure if I want to support pmatic on Windows. It seems to be a reasonable target to support it, but I have no experience yet with supporting Python code like on Windows and Linux.
According to the examples I tried this on the CCU2:
So no address and no credentials as I'm running it on the CCU locally. That fails with: