Public Member Functions | Public Attributes | Private Attributes | List of all members
switchbot_ros.switchbot.SwitchBotAPIClient Class Reference
Inheritance diagram for switchbot_ros.switchbot.SwitchBotAPIClient:
Inheritance graph
[legend]

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
 

Detailed Description

For Using SwitchBot via official API.
Please see https://github.com/OpenWonderLabs/SwitchBotAPI for details.

Definition at line 8 of file switchbot.py.

Constructor & Destructor Documentation

◆ __init__()

def switchbot_ros.switchbot.SwitchBotAPIClient.__init__ (   self,
  token 
)

Definition at line 13 of file switchbot.py.

Member Function Documentation

◆ control_device()

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.

◆ device_status()

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.

◆ execute_scene()

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.

◆ request()

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.

◆ update_device_list()

def switchbot_ros.switchbot.SwitchBotAPIClient.update_device_list (   self)
Update the information of deviceIds, deviceNames, deviceBots.

Definition at line 81 of file switchbot.py.

◆ update_scene_list()

def switchbot_ros.switchbot.SwitchBotAPIClient.update_scene_list (   self)
Update the information of sceneIDs, sceneNames.

Definition at line 96 of file switchbot.py.

Member Data Documentation

◆ _host_domain

switchbot_ros.switchbot.SwitchBotAPIClient._host_domain
private

Definition at line 14 of file switchbot.py.

◆ device_list

switchbot_ros.switchbot.SwitchBotAPIClient.device_list

Definition at line 16 of file switchbot.py.

◆ device_name_id

switchbot_ros.switchbot.SwitchBotAPIClient.device_name_id

Definition at line 19 of file switchbot.py.

◆ infrared_remote_list

switchbot_ros.switchbot.SwitchBotAPIClient.infrared_remote_list

Definition at line 17 of file switchbot.py.

◆ scene_list

switchbot_ros.switchbot.SwitchBotAPIClient.scene_list

Definition at line 18 of file switchbot.py.

◆ scene_name_id

switchbot_ros.switchbot.SwitchBotAPIClient.scene_name_id

Definition at line 20 of file switchbot.py.

◆ token

switchbot_ros.switchbot.SwitchBotAPIClient.token

Definition at line 15 of file switchbot.py.


The documentation for this class was generated from the following file:


switchbot_ros
Author(s): Yoshiki Obinata
autogenerated on Sat Jun 24 2023 02:40:43