dwighthubbard / python-dlipower

Python modules to manage Digital Loggers Web Power Switch
Other
54 stars 35 forks source link

Outlet number 5 out of range #46

Open microflyer2001 opened 4 years ago

microflyer2001 commented 4 years ago

If there is a user setup on the switch with access to only 3 outlets (2,3 and 5 for example) then if you try to operate outlet 5 you get

File "C:\xxx\dlipower\dlipower.py", line 431, in determine_outlet raise DLIPowerException('Outlet number %d out of range' % outlet_int) dlipower.dlipower.DLIPowerException: Outlet number 5 out of range

It assumes because it can only see 3 outlets they should be numbered 1,2,3

The relevant variables are:

outlet =5 outlets=[[2, '4-2', 'ON'], [3, '4-3', 'ON'], [5, '4-5', 'ON']] len=3

Without changing the code the only solution seems to be to use 'admin' user.