https://github.com/dwighthubbard/python-dlipower
Python modules to manage Digital Loggers Web Power Switch
https://github.com/dwighthubbard/python-dlipower
Last synced: 2 months ago
JSON representation
Python modules to manage Digital Loggers Web Power Switch
- Host: GitHub
- URL: https://github.com/dwighthubbard/python-dlipower
- Owner: dwighthubbard
- License: other
- Created: 2011-03-30T12:12:08.000Z (about 14 years ago)
- Default Branch: master
- Last Pushed: 2024-07-08T01:08:06.000Z (11 months ago)
- Last Synced: 2025-04-10T01:15:18.271Z (2 months ago)
- Language: Python
- Homepage:
- Size: 295 KB
- Stars: 55
- Watchers: 14
- Forks: 35
- Open Issues: 20
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
[](https://cd.screwdriver.cd/pipelines/5669)
[](https://pypi.org/project/dlipower/)
[](https://www.python.org/dev/peps/pep-0008/)
[](http://dlipower.readthedocs.org/en/latest/)---
# Digital Loggers Network Power Switch Python Module
This is a python module and a script to mange the
Digital Loggers Web Power switch.
The module provides a python class named
PowerSwitch that allows managing the web power
switch from python programs.When run as a script this acts as a command
line utility to manage the DLI Power switch.# SUPPORTED DEVICES
This module has been tested against the following
Digital Loggers Power network power switches:* ProSwitch
* WebPowerSwitch II
* WebPowerSwitch III
* WebPowerSwitch IV
* WebPowerSwitch V
* Ethernet Power Controller III# Example
```python
import dlipowerprint('Connecting to a DLI PowerSwitch at lpc.digital-loggers.com')
switch = dlipower.PowerSwitch(hostname="lpc.digital-loggers.com", userid="admin")print('Turning off the first outlet')
switch.off(1)print('The powerstate of the first outlet is currently', switch[0].state)
print('Renaming the first outlet as "Traffic light"')
switch[0].name = 'Traffic light'print('The current status of the powerswitch is:')
print(switch)
``````console
Connecting to a DLI PowerSwitch at lpc.digital-loggers.com
Turning off the first outlet
The powerstate of the first outlet is currently OFF
Renaming the first outlet as "Traffic light"
The current status of the powerswitch is:
DLIPowerSwitch at lpc.digital-loggers.com
Outlet Hostname State
1 Traffic light OFF
2 killer robot ON
3 Buiten verlicti ON
4 Meeting Room Li OFF
5 Brocade LVM123 ON
6 Shoretel ABC123 ON
7 Shortel 24V - T ON
8 Shortel 24V - T ON
```