Bridge 🔗
Bridge(*, ip: str, user: str) -> Bridge
Interact with the Hue Bridge API
Examples:
>>> from hue import Bridge
>>> bridge = Bridge(ip="192.168.1.10", user="xxxx")
>>> print(bridge.url)
http://192.168.1.10/api/xxxx
Attributes:
Name | Type | Description |
---|---|---|
ip |
str
|
IP address of the Hue Bridge |
user |
str
|
The secret user id used to access the Hue API |
info |
dict[str, Any]
|
The last Bridge information stored in the object
by calling |
Initialize a Hue Bridge object
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ip |
str
|
IP address of the Hue Bridge, get it by running |
required |
user |
str
|
The secret user id created to access the Hue API |
required |
Returns:
Type | Description |
---|---|
Bridge
|
An object of class Bridge |
Source code in hue/api/bridge.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
|
Functions🔗
discover
async
staticmethod
🔗
discover() -> list[dict[str, str]]
Discover Hue Bridges available in this local network
Returns:
Type | Description |
---|---|
list[dict[str, str]]
|
A list of Hue Bridges discovered in the local network |
Source code in hue/api/bridge.py
49 50 51 52 53 54 55 56 57 |
|
get_config
async
🔗
get_config() -> dict[str, Any]
Get the current config of the Bridge
Returns:
Type | Description |
---|---|
dict[str, Any]
|
A dictionary of the configuration of the Hue Bridge |
Source code in hue/api/bridge.py
69 70 71 72 73 74 75 76 77 |
|
get_info
async
🔗
get_info() -> dict[str, Any]
List all the information about the Hue Bridge
Returns:
Type | Description |
---|---|
dict[str, Any]
|
A dictionary of all the information about the Hue Bridge |
Source code in hue/api/bridge.py
59 60 61 62 63 64 65 66 67 |
|
url
property
🔗
url() -> str
Returns the Hue Bridge URL
Source code in hue/api/bridge.py
44 45 46 47 |
|