finish06 / pyunifi

https://unifi-sdn.ubnt.com/
MIT License
228 stars 99 forks source link

switch_port_power_off error #68

Open caco3 opened 3 years ago

caco3 commented 3 years ago

switch_port_power_off or switch_port_power_on will fail: TypeError: list indices must be integers or slices, not dict.

I fixed it with replacing for i in overrides: with for i in range(len(overrides)): in _switch_port_power().

marc-odp commented 2 years ago

Is this replaced in the source code ? I did pip install pyunifi and got the error.

caco3 commented 2 years ago

@marc-odp I don't think so, I never did a Pull Request and nobody else cared about this.

marc-odp commented 2 years ago

I think one solution to this issue is in discussion in Pull Requests : https://github.com/finish06/pyunifi/pull/70#issue-1096583226 However it is not yet in the Code.