ZoneService
A list of all methods in the ZoneService
service. Click on the method name to view detailed information about that method.
Methods | Description |
---|---|
get_zones | List all available zones |
create_zone | Create a new zone |
get_zone | Get details of a single Zone from its given {zoneId} |
update_zone | Update a single Zone from its given {zoneId} |
delete_zone | Delete a single Zone from its given {zoneId} |
get_zones
List all available zones
- HTTP Method:
GET
- Endpoint:
/clip/v2/resource/zone
Return Type
GetZonesOkResponse
Example Usage Code Snippet
from open_hue import OpenHue, Environment
sdk = OpenHue(
api_key="YOUR_API_KEY",
api_key_header="YOUR_API_KEY_HEADER",
base_url=Environment.DEFAULT.value
)
result = sdk.zone.get_zones()
print(result)
create_zone
Create a new zone
- HTTP Method:
POST
- Endpoint:
/clip/v2/resource/zone
Parameters
Name | Type | Required | Description |
---|---|---|---|
request_body | RoomPut | ❌ | The request body. |
Return Type
CreateZoneOkResponse
Example Usage Code Snippet
from open_hue import OpenHue, Environment
from open_hue.models import RoomPut
sdk = OpenHue(
api_key="YOUR_API_KEY",
api_key_header="YOUR_API_KEY_HEADER",
base_url=Environment.DEFAULT.value
)
request_body = RoomPut(
type_="type",
children=[
{
"rid": "42edd1f5-9538-4180-9ced-2d9e07f26d0f",
"rtype": "device"
}
],
metadata={
"name": "name",
"archetype": "living_room"
}
)
result = sdk.zone.create_zone(request_body=request_body)
print(result)
get_zone
Get details of a single Zone from its given {zoneId}
- HTTP Method:
GET
- Endpoint:
/clip/v2/resource/zone/{zoneId}
Parameters
Name | Type | Required | Description |
---|---|---|---|
zone_id | str | ✅ | ID of the Zone |
Return Type
GetZoneOkResponse
Example Usage Code Snippet
from open_hue import OpenHue, Environment
sdk = OpenHue(
api_key="YOUR_API_KEY",
api_key_header="YOUR_API_KEY_HEADER",
base_url=Environment.DEFAULT.value
)
result = sdk.zone.get_zone(zone_id="zoneId")
print(result)
update_zone
Update a single Zone from its given {zoneId}
- HTTP Method:
PUT
- Endpoint:
/clip/v2/resource/zone/{zoneId}
Parameters
Name | Type | Required | Description |
---|---|---|---|
request_body | RoomPut | ❌ | The request body. |
zone_id | str | ✅ | ID of the Zone |
Return Type
UpdateZoneOkResponse
Example Usage Code Snippet
from open_hue import OpenHue, Environment
from open_hue.models import RoomPut
sdk = OpenHue(
api_key="YOUR_API_KEY",
api_key_header="YOUR_API_KEY_HEADER",
base_url=Environment.DEFAULT.value
)
request_body = RoomPut(
type_="type",
children=[
{
"rid": "42edd1f5-9538-4180-9ced-2d9e07f26d0f",
"rtype": "device"
}
],
metadata={
"name": "name",
"archetype": "living_room"
}
)
result = sdk.zone.update_zone(
request_body=request_body,
zone_id="zoneId"
)
print(result)
delete_zone
Delete a single Zone from its given {zoneId}
- HTTP Method:
DELETE
- Endpoint:
/clip/v2/resource/zone/{zoneId}
Parameters
Name | Type | Required | Description |
---|---|---|---|
zone_id | str | ✅ | ID of the Zone |
Return Type
DeleteZoneOkResponse
Example Usage Code Snippet
from open_hue import OpenHue, Environment
sdk = OpenHue(
api_key="YOUR_API_KEY",
api_key_header="YOUR_API_KEY_HEADER",
base_url=Environment.DEFAULT.value
)
result = sdk.zone.delete_zone(zone_id="zoneId")
print(result)
Build Your Own SDKs with liblab
Build developer friendly SDKs in minutes from your APIs