Emergency Trait
API Service: EmergencyApi
Report and manages emergencies. Typically not associated with a single device, more suited to buildings or spaces. It's likely that some implementation will not allow write of emergency state.
| Method | Request Type | Response Type | Description |
|---|---|---|---|
| GetEmergency | GetEmergencyRequest | Emergency | Get the current emergency state |
| UpdateEmergency | UpdateEmergencyRequest | Emergency | Update the current emergency state |
| PullEmergency | PullEmergencyRequest | PullEmergencyResponse stream | Be notified of changes to the emergency state |
Info Service: EmergencyInfo
Describes the capabilities of a specific named device with respect to this trait.
| Method | Request Type | Response Type | Description |
|---|---|---|---|
| DescribeEmergency | DescribeEmergencyRequest | EmergencySupport | Get information about how a named device implements Emergency features |
Emergency
An emergency is a life threatening event.
| Field Name | Type | Description |
|---|---|---|
| level | Emergency.Level | The level of emergency that is active. |
| reason | string | A textual description of the reason for the emergency. For example "Fire alarm triggered", "Excessive pressure" |
| level_change_time | google.protobuf.Timestamp | The time the emergency level was changed. When writing and absent, and the level has changed, then server time will be used. |
| silent | bool | Silent emergencies are ongoing but don't require continued or excessive user feedback. |
| drill | bool | The emergency being fabricated, typically for testing. |
Emergency.Level
Levels of emergency
| Name | Number | Description |
|---|---|---|
| LEVEL_UNSPECIFIED | 0 | The level is unknown, applications may choose to be cautious or care-free with this lack of information. |
| OK | 1 | There is no emergency. |
| WARNING | 2 | There is a chance of an emergency soon. This might be reported by a smoke detector that has detected some particles but not enough to trigger the alarm yet. |
| EMERGENCY | 3 | There is an emergency. Please protect yourself and follow emergency procedures. |
EmergencySupport
EmergencySupport describes the capabilities of devices implementing this trait
| Field Name | Type | Description |
|---|---|---|
| resource_support | smartcore.types.ResourceSupport | How a named device supports read/write/pull apis |
GetEmergencyRequest
| Field Name | Type | Description |
|---|---|---|
| name | string | |
| read_mask | google.protobuf.FieldMask | The state fields to fetch |
UpdateEmergencyRequest
| Field Name | Type | Description |
|---|---|---|
| name | string | |
| emergency | Emergency | |
| update_mask | google.protobuf.FieldMask | The fields relative to state we intend to update |
PullEmergencyRequest
| Field Name | Type | Description |
|---|---|---|
| name | string | |
| read_mask | google.protobuf.FieldMask | The state fields to fetch |
| updates_only | bool | When true the device will only send changes to the resource value. The default behaviour is to send the current value immediately followed by any updates as they happen. |
PullEmergencyResponse
| Field Name | Type | Description |
|---|---|---|
| changes | repeated PullEmergencyResponse.Change |
PullEmergencyResponse.Change
| Field Name | Type | Description |
|---|---|---|
| name | string | name for the device that issued the change |
| change_time | google.protobuf.Timestamp | when the change occurred |
| emergency | Emergency | The new value for the emergency. |
DescribeEmergencyRequest
| Field Name | Type | Description |
|---|---|---|
| name | string | The name of the device |