Public Member Functions | Public Attributes | Private Attributes
rocon_python_hue.phue.Bridge Class Reference

List of all members.

Public Member Functions

def __getitem__
def __init__
def check_user_validation
def connect
def create_group
def create_group_schedule
def create_schedule
def delete_group
def delete_schedule
def get_api
def get_group
def get_group_id_by_name
def get_ip_address
def get_light
def get_light_id_by_name
def get_light_objects
def get_schedule
def groups
def lights
def name
def name
def register_app
def request
def set_group
def set_ip_address
def set_light

Public Attributes

 ip
 is_connect
 lights_by_id
 lights_by_name
 username

Private Attributes

 _name

Detailed Description

Interface to the Hue ZigBee bridge

You can obtain Light objects by calling the get_light_objects method:

    >>> b = Bridge(ip='192.168.1.100')
    >>> b.get_light_objects()
    [<phue.Light at 0x10473d750>,
     <phue.Light at 0x1046ce110>]

Or more succinctly just by accessing this Bridge object as a list or dict:

    >>> b[0]
    <phue.Light at 0x10473d750>
    >>> b['Kitchen']
    <phue.Light at 0x1046ce110>



Definition at line 382 of file phue.py.


Constructor & Destructor Documentation

def rocon_python_hue.phue.Bridge.__init__ (   self,
  ip = None,
  username = None 
)
Initialization function.

Parameters:
------------
ip : string
    IP address as dotted quad
username : string, optional

Definition at line 403 of file phue.py.


Member Function Documentation

def rocon_python_hue.phue.Bridge.__getitem__ (   self,
  key 
)
Lights are accessibly by indexing the bridge either with
an integer index or string name. 

Definition at line 598 of file phue.py.

Definition at line 534 of file phue.py.

Connect to the Hue bridge 

Definition at line 553 of file phue.py.

def rocon_python_hue.phue.Bridge.create_group (   self,
  name,
  lights = None 
)
Create a group of lights

Parameters
------------
name : string
    Name for this group of lights
lights : list
    List of lights to be in the group.

Definition at line 808 of file phue.py.

def rocon_python_hue.phue.Bridge.create_group_schedule (   self,
  name,
  time,
  group_id,
  data,
  description = ' ' 
)

Definition at line 847 of file phue.py.

def rocon_python_hue.phue.Bridge.create_schedule (   self,
  name,
  time,
  light_id,
  data,
  description = ' ' 
)

Definition at line 832 of file phue.py.

def rocon_python_hue.phue.Bridge.delete_group (   self,
  group_id 
)

Definition at line 822 of file phue.py.

def rocon_python_hue.phue.Bridge.delete_schedule (   self,
  schedule_id 
)

Definition at line 862 of file phue.py.

Returns the full api dictionary 

Definition at line 621 of file phue.py.

def rocon_python_hue.phue.Bridge.get_group (   self,
  group_id = None,
  parameter = None 
)

Definition at line 726 of file phue.py.

Lookup a group id based on string name. Case-sensitive. 

Definition at line 714 of file phue.py.

def rocon_python_hue.phue.Bridge.get_ip_address (   self,
  set_result = False 
)
Get the bridge ip address from the meethue.com nupnp api 

Definition at line 479 of file phue.py.

def rocon_python_hue.phue.Bridge.get_light (   self,
  light_id = None,
  parameter = None 
)
Gets state by light_id and parameter

Definition at line 625 of file phue.py.

Lookup a light id based on string name. Case-sensitive. 

Definition at line 565 of file phue.py.

def rocon_python_hue.phue.Bridge.get_light_objects (   self,
  mode = 'list' 
)
Returns a collection containing the lights, either by name or id (use 'id' or 'name' as the mode)
The returned collection can be either a list (default), or a dict.
Set mode='id' for a dict by light ID, or mode='name' for a dict by light name.   

Definition at line 577 of file phue.py.

def rocon_python_hue.phue.Bridge.get_schedule (   self,
  schedule_id = None,
  parameter = None 
)

Definition at line 826 of file phue.py.

Access groups as a list 

Definition at line 710 of file phue.py.

Access lights as a list 

Definition at line 617 of file phue.py.

Get or set the name of the bridge [string]

Definition at line 427 of file phue.py.

def rocon_python_hue.phue.Bridge.name (   self,
  value 
)

Definition at line 434 of file phue.py.

Register this computer with the Hue bridge hardware and save the resulting access token 

Definition at line 513 of file phue.py.

def rocon_python_hue.phue.Bridge.request (   self,
  mode = 'GET',
  address = None,
  data = None 
)
Utility function for HTTP GET/PUT requests for the API

Definition at line 440 of file phue.py.

def rocon_python_hue.phue.Bridge.set_group (   self,
  group_id,
  parameter,
  value = None,
  transitiontime = None 
)
Change light settings for a group

group_id : int, id number for group
parameter : 'name' or 'lights'
value: string, or list of light IDs if you're setting the lights

Definition at line 745 of file phue.py.

def rocon_python_hue.phue.Bridge.set_ip_address (   self,
  ip_address = '127.0.0.1' 
)

Definition at line 476 of file phue.py.

def rocon_python_hue.phue.Bridge.set_light (   self,
  light_id,
  parameter,
  value = None,
  transitiontime = None 
)
Adjust properties of one or more lights.

light_id can be a single lamp or an array of lamps
parameters: 'on' : True|False , 'bri' : 0-254, 'sat' : 0-254, 'ct': 154-500

transitiontime : in **deciseconds**, time for this transition to take place
         Note that transitiontime only applies to *this* light
         command, it is not saved as a setting for use in the future!
         Use the Light class' transitiontime attribute if you want
         persistent time settings.

Definition at line 647 of file phue.py.


Member Data Documentation

Definition at line 411 of file phue.py.

Definition at line 411 of file phue.py.

Definition at line 411 of file phue.py.

Definition at line 411 of file phue.py.

Definition at line 411 of file phue.py.

Definition at line 411 of file phue.py.


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


rocon_python_hue
Author(s):
autogenerated on Thu Jun 6 2019 17:58:50