
| Public Member Functions | |
| def | __init__ (self, token) | 
| def | control_device (self, command, parameter='default', command_type='command', device_id=None, device_name=None) | 
| def | device_status (self, device_id=None, device_name=None) | 
| def | execute_scene (self, scene_id=None, scene_name=None) | 
| def | request (self, method='GET', devices_or_scenes='devices', service_id='', service='', json_body=None) | 
| def | update_device_list (self) | 
| def | update_scene_list (self) | 
| Public Attributes | |
| device_list | |
| device_name_id | |
| infrared_remote_list | |
| scene_list | |
| scene_name_id | |
| token | |
| Private Attributes | |
| _host_domain | |
For Using SwitchBot via official API. Please see https://github.com/OpenWonderLabs/SwitchBotAPI for details.
Definition at line 8 of file switchbot.py.
| def switchbot_ros.switchbot.SwitchBotAPIClient.__init__ | ( | self, | |
| token | |||
| ) | 
Definition at line 13 of file switchbot.py.
| def switchbot_ros.switchbot.SwitchBotAPIClient.control_device | ( | self, | |
| command, | |||
| parameter = 'default', | |||
| command_type = 'command', | |||
| device_id = None, | |||
| device_name = None | |||
| ) | 
Send Command to the device. Please see https://github.com/OpenWonderLabs/SwitchBotAPI#send-device-control-commands for command options.
Definition at line 124 of file switchbot.py.
| def switchbot_ros.switchbot.SwitchBotAPIClient.device_status | ( | self, | |
| device_id = None, | |||
| device_name = None | |||
| ) | 
Get the device status.
Definition at line 107 of file switchbot.py.
| def switchbot_ros.switchbot.SwitchBotAPIClient.execute_scene | ( | self, | |
| scene_id = None, | |||
| scene_name = None | |||
| ) | 
Execute your registered scene.
Definition at line 146 of file switchbot.py.
| def switchbot_ros.switchbot.SwitchBotAPIClient.request | ( | self, | |
| method = 'GET', | |||
| devices_or_scenes = 'devices', | |||
| service_id = '', | |||
| service = '', | |||
| json_body = None | |||
| ) | 
Execute HTTP request
Definition at line 25 of file switchbot.py.
| def switchbot_ros.switchbot.SwitchBotAPIClient.update_device_list | ( | self | ) | 
Update the information of deviceIds, deviceNames, deviceBots.
Definition at line 81 of file switchbot.py.
| def switchbot_ros.switchbot.SwitchBotAPIClient.update_scene_list | ( | self | ) | 
Update the information of sceneIDs, sceneNames.
Definition at line 96 of file switchbot.py.
| 
 | private | 
Definition at line 14 of file switchbot.py.
| switchbot_ros.switchbot.SwitchBotAPIClient.device_list | 
Definition at line 16 of file switchbot.py.
| switchbot_ros.switchbot.SwitchBotAPIClient.device_name_id | 
Definition at line 19 of file switchbot.py.
| switchbot_ros.switchbot.SwitchBotAPIClient.infrared_remote_list | 
Definition at line 17 of file switchbot.py.
| switchbot_ros.switchbot.SwitchBotAPIClient.scene_list | 
Definition at line 18 of file switchbot.py.
| switchbot_ros.switchbot.SwitchBotAPIClient.scene_name_id | 
Definition at line 20 of file switchbot.py.
| switchbot_ros.switchbot.SwitchBotAPIClient.token | 
Definition at line 15 of file switchbot.py.