@@ -139,11 +139,47 @@ SwitchBotAPIResponse(status_code=100, message='success', body={})
139139The specified scene can be executed immediately.
140140
141141
142+ ### Examples
143+
144+ ``` python
145+ from switchbot_client.enums import ControlCommand
146+ from switchbot_client import SwitchBotAPIClient
147+
148+
149+ def control_all_infrared_remotes_by_type (type : str , command : str ):
150+ client = SwitchBotAPIClient()
151+ devices = client.devices()
152+ infrared_remotes = devices.body[" infraredRemoteList" ]
153+ devices = filter (lambda d : d[" remoteType" ] == type , infrared_remotes)
154+
155+ for d in devices:
156+ client.devices_control(d[" deviceId" ], command)
157+
158+
159+ def call_this_function_when_i_go_out ():
160+ print (" turn off all lights and air conditioners..." )
161+ control_all_infrared_remotes_by_type(
162+ " Light" , ControlCommand.VirtualInfrared.TURN_OFF
163+ )
164+ control_all_infrared_remotes_by_type(
165+ " Air Conditioner" , ControlCommand.VirtualInfrared.TURN_OFF
166+ )
167+ print (" done" )
168+ ```
169+
142170## License
143171
144172Licensed under either of
145173
146- - Apache License, Version 2.0, ([ LICENSE-APACHE] ( LICENSE-APACHE ) or http://www.apache.org/licenses/LICENSE-2.0 )
147- - MIT license ([ LICENSE-MIT] ( LICENSE-MIT ) or http://opensource.org/licenses/MIT )
174+ * Apache License, Version 2.0
175+ ([ LICENSE-APACHE] ( LICENSE-APACHE ) or http://www.apache.org/licenses/LICENSE-2.0 )
176+ * MIT license
177+ ([ LICENSE-MIT] ( LICENSE-MIT ) or http://opensource.org/licenses/MIT )
148178
149179at your option.
180+
181+ ## Contribution
182+
183+ Unless you explicitly state otherwise, any contribution intentionally submitted
184+ for inclusion in the work by you, as defined in the Apache-2.0 license, shall be
185+ dual licensed as above, without any additional terms or conditions.
0 commit comments