File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ async def discover():
3939 f" MAC address: { device .mac } , IP address: { device .host } , HW: { device .hardware } "
4040 )
4141
42+
4243@main .group ("info" )
4344def info ():
4445 """Get the information of a dingz device."""
@@ -56,5 +57,33 @@ async def get_config(ip):
5657 await dingz .get_device_info ()
5758 click .echo (dingz .device_details )
5859
60+
61+ @main .group ("front_led" )
62+ def front_led ():
63+ """Handle the front LED of dingz."""
64+
65+
66+ @front_led .command ("on" )
67+ @coro
68+ @click .option (
69+ "--ip" , prompt = "IP address of the device" , help = "IP address of the device."
70+ )
71+ async def set_on (ip ):
72+ """Turn the front LED on."""
73+ async with Dingz (ip ) as dingz :
74+ await dingz .turn_on ()
75+
76+
77+ @front_led .command ("off" )
78+ @coro
79+ @click .option (
80+ "--ip" , prompt = "IP address of the device" , help = "IP address of the device."
81+ )
82+ async def set_off (ip ):
83+ """Turn the front LED off."""
84+ async with Dingz (ip ) as dingz :
85+ await dingz .turn_off ()
86+
87+
5988if __name__ == "__main__" :
6089 main ()
You can’t perform that action at this time.
0 commit comments