控制数字记录器网络电源开关
dlipower的Python项目详细描述
说明
这是一个python模块和一个脚本,用于管理 数字记录器网络电源开关。
模块提供一个名为 允许管理网络电源的电源开关 从python程序切换。
当作为脚本运行时,它充当命令 用于管理DLI电源开关的线路实用程序。
支持的设备
该模块已经过以下测试 数字记录器电源网络电源开关:
- Proswitch
- Webpowerswitch II
- Webpowerswitch III
- Webpowerswitch四
- 网络电源开关V
- 以太网电源控制器III
示例
importdlipowerprint('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)ConnectingtoaDLIPowerSwitchatlpc.digital-loggers.comTurningoffthefirstoutletThepowerstateofthefirstoutletiscurrentlyOFFRenamingthefirstoutletas"Traffic light"Thecurrentstatusofthepowerswitchis:DLIPowerSwitchatlpc.digital-loggers.comOutletHostnameState1TrafficlightOFF2killerrobotON3BuitenverlictiON4MeetingRoomLiOFF5BrocadeLVM123ON6ShoretelABC123ON7Shortel24V-TON8Shortel24V-TON