getTimeZoneId method

Future<int?> getTimeZoneId()

Get the time zone ID of the time zone.

Implementation

Future<int?> getTimeZoneId() async {
  if (_timeZoneId == null) {
    _log.warning("Time Zone Id characteristic not found on device");
    return null;
  }
  List<int> bytes = await _timeZoneId!.read();
  ByteData byteData = ByteData.sublistView(Uint8List.fromList(bytes));
  int timeZoneId = byteData.getInt64(0, Endian.little);
  return timeZoneId;
}