Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

* renamed TauRing to OpenRing
* added support for OpenRing temperature sensors (`temp0`, `temp1`, `temp2`) as one 3-channel `Temperature` sensor (`°C`) with software-only on/off control
* Added support for device images with stereo support to display an image for a group of devices

## 2.3.2

Expand Down
Binary file added assets/wearable_icons/open_earable_v2/left.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/wearable_icons/open_earable_v2/pair.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/wearable_icons/open_earable_v2/right.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion lib/src/models/devices/cosinuss_one.dart
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,10 @@ class CosinussOne extends Wearable
}

@override
String? getWearableIconPath({bool darkmode = false}) {
String? getWearableIconPath({
bool darkmode = false,
WearableIconVariant variant = WearableIconVariant.single,
}) {
String basePath =
'packages/open_earable_flutter/assets/wearable_icons/cosinuss_one';

Expand Down
5 changes: 4 additions & 1 deletion lib/src/models/devices/open_earable_v1.dart
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,10 @@ class OpenEarableV1 extends Wearable
}

@override
String? getWearableIconPath({bool darkmode = false}) {
String? getWearableIconPath({
bool darkmode = false,
WearableIconVariant variant = WearableIconVariant.single,
}) {
String basePath =
'packages/open_earable_flutter/assets/wearable_icons/open_earable_v1';

Expand Down
18 changes: 17 additions & 1 deletion lib/src/models/devices/open_earable_v2.dart
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,26 @@ class OpenEarableV2 extends BluetoothWearable
String get deviceId => discoveredDevice.id;

@override
String? getWearableIconPath({bool darkmode = false}) {
String? getWearableIconPath({
bool darkmode = false,
WearableIconVariant variant = WearableIconVariant.single,
}) {
String basePath =
'packages/open_earable_flutter/assets/wearable_icons/open_earable_v2';

if (!darkmode) {
switch (variant) {
case WearableIconVariant.left:
return '$basePath/left.png';
case WearableIconVariant.right:
return '$basePath/right.png';
case WearableIconVariant.pair:
return '$basePath/pair.png';
case WearableIconVariant.single:
break;
}
}

if (darkmode) {
return '$basePath/icon_no_text_white.svg';
}
Expand Down
1 change: 1 addition & 0 deletions lib/src/models/devices/open_ring.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class OpenRing extends Wearable
@override
String? getWearableIconPath({
bool darkmode = false,
WearableIconVariant variant = WearableIconVariant.single,
}) {
return 'packages/open_earable_flutter/assets/wearable_icons/open_ring/openring.png';
}
Expand Down
5 changes: 4 additions & 1 deletion lib/src/models/devices/polar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ class Polar extends Wearable
_discoveredDevice = discoveredDevice;

@override
String? getWearableIconPath({bool darkmode = false}) {
String? getWearableIconPath({
bool darkmode = false,
WearableIconVariant variant = WearableIconVariant.single,
}) {
String basePath =
'packages/open_earable_flutter/assets/wearable_icons/polar';

Expand Down
13 changes: 12 additions & 1 deletion lib/src/models/devices/wearable.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ import 'dart:ui';

import '../../managers/wearable_disconnect_notifier.dart';

enum WearableIconVariant {
single,
left,
right,
pair,
}

abstract class Wearable {
final String name;

Expand Down Expand Up @@ -85,7 +92,11 @@ abstract class Wearable {
/// The parameters are best-effort
///
/// @param darkmode: Whether the icon should be for dark mode (if available).
String? getWearableIconPath({bool darkmode = false}) {
/// @param variant: Which icon variant should be used.
String? getWearableIconPath({
bool darkmode = false,
WearableIconVariant variant = WearableIconVariant.single,
}) {
return null;
}

Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: open_earable_flutter
description: This package provides functionality for interacting with OpenEarable devices. Control LED colors, control audio, and access raw sensor data.
version: 2.3.2
version: 2.3.3
repository: https://github.com/OpenEarable/open_earable_flutter/tree/main

platforms:
Expand Down