HardwareDeviceRegistration
A DeviceRegistration for a hardware device, with its name and battery state.
- Inheritance
-
- Object
- Serializable
- DeviceRegistration
- CamsDeviceRegistration
- HardwareDeviceRegistration
- Implementers
- Annotations
-
- @JsonSerializable(includeIfNull: false, explicitToJson: true)
Constructors
HardwareDeviceRegistration.fromJson
HardwareDeviceRegistration
Creates a new HardwareDeviceRegistration based on hardware information, incl. hardwareName and batteryChargingState.
If no deviceDisplayName is given, it is built from hardwareName and batteryChargingState.
Properties
batteryChargingState
getter/setter pair
The battery charging state of the device upon registration.
fromJsonFunction
The function which can convert a JSON string to an object of this type.
hardwareName
getter/setter pair
The hardware name of this device, if available.
Methods
parseBatteryLevel
- int batteryLevel
The BatteryChargingState for a battery level percentage (0-100).
0-10 is critical, 11-20 low, 21-90 normal, 91-100 full, and anything above 100 unknown.
toJson
Return a JSON encoding of this object.