Room events
Field paths are relative to one object in the message array. [] means an array item: for example, services[].rid is the rid of each service. Fields under value are shown as value.name, value.color_arr[].x, and so on.
Room added
Topic
res/room/add
Example message
json
[
{
"id": "748670A4-EE28-4D08-B9A7-3D7F217A7E6B",
"type": "room",
"name": "主卧",
"room_kind": 0,
"room_type": "",
"background": 1,
"icon": "assets/room/room4.png",
"sequence": 0,
"children": [],
"services": [
{
"rid": "B59EAB99-7D80-4AD2-8C2C-126ED7BED25F",
"rtype": "group_light"
}
]
}
]Fields
| Field | Type | Description |
|---|---|---|
id | string | Room UUID. |
type | string | Always room. |
name | string | Room name |
room_kind | integer | Always 0. |
room_type | string | Room category, expressed as a free-form string. |
sequence | integer | Room order, expressed as a number. |
children | object[] | Always an empty array. |
services | object[] | List of supported services. |
services[].rid | string | Resource UUID |
services[].rtype | string | Resource type |
background | integer | BweeApp only: room wallpaper index. |
icon | string | BweeApp only: room wallpaper name. |
Event details
- Sent when a new room is created.
- New rooms have no devices yet, so
childrenis empty in this event.
Room deleted
Topic
res/room/remove
Example message
json
[
{
"id": "748670A4-EE28-4D08-B9A7-3D7F217A7E6B",
"type": "room"
}
]Fields
| Field | Type | Description |
|---|---|---|
id | string | Room UUID. |
type | string | Always room. |
Event details
- Sent when a room is deleted.
Room updated
Topic
res/room/update
Example message
json
[
{
"id": "748670A4-EE28-4D08-B9A7-3D7F217A7E6B",
"value": {
"name": "主卧(南)"
}
}
]Fields
| Field | Type | Description |
|---|---|---|
id | string | Room ID. |
value | object | Fields changed by this event. |
Fields in value
| Field | Type | Description |
|---|---|---|
value.name | string | Room name |
value.room_type | string | Room type |
value.sequence | integer | Room sequence number |
value.background | integer | Room background index |
value.icon | string | Room background name |
value.device_add | string[] | UUIDs of devices added to the room. |
value.device_del | string[] | UUIDs of devices removed from the room. |
Event details
- Sent when the room's properties change. The
valueobject contains only the changed fields. - Apply the fields in
valueto your local state. Fields absent from the message have not changed.