Skip to content

Commit

Permalink
All your (anonymous) data are belong to us
Browse files Browse the repository at this point in the history
  • Loading branch information
Codel1417 committed Mar 4, 2024
1 parent 3cc58b1 commit 1e779ea
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions lib/Backend/moveLists.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import 'package:tail_app/Backend/Definitions/Action/BaseAction.dart';
import 'package:tail_app/Backend/Definitions/Device/BaseDeviceDefinition.dart';
import 'package:tail_app/Frontend/intnDefs.dart';

import '../main.dart';

part 'moveLists.g.dart';

@HiveType(typeId: 10)
Expand Down Expand Up @@ -179,8 +181,10 @@ class MoveLists extends _$MoveLists {
Future<void> runAction(BaseAction action, BaseStatefulDevice device) async {
if (action is CommandAction) {
device.commandQueue.addCommand(BluetoothMessage.response(action.command, device, Priority.normal, action.response));
plausible.event(name: "Run Action", props: {"Action Name": action.name, "Action Type": action.actionCategory.name});
} else if (action is MoveList) {
Flogger.i("Starting MoveList ${action.name}.");
plausible.event(name: "Run Sequence", props: {"Sequence Repeat": action.repeat.toInt().toString(), "Sequence Device Type": device.baseDeviceDefinition.deviceType.name, "Sequence Moves": action.moves.length.toString()});
if (action.moves.isNotEmpty && action.moves.length <= 5 && device.baseDeviceDefinition.deviceType != DeviceType.ears) {
int preset = 1; //TODO: store
String cmd = "USERMOVE U${preset}P${action.moves.length}N${action.repeat.toInt()}H1";
Expand Down
2 changes: 1 addition & 1 deletion lib/Frontend/Widgets/scan_for_new_device.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class _ScanForNewDevice extends ConsumerState<ScanForNewDevice> {
trailing: Text(e.id),
onTap: () {
ref.watch(knownDevicesProvider.notifier).connect(e);
plausible.event(name: "Connect New Gear", props: {"Type": e.name});
plausible.event(name: "Connect New Gear", props: {"Gear Type": e.name});
setState(
() {
devices.remove(e.id);
Expand Down
4 changes: 2 additions & 2 deletions lib/Frontend/pages/triggers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class _TriggersState extends ConsumerState<Triggers> {
() {
Trigger trigger = Trigger.trigDef(triggerDefinition!, const Uuid().v4());
ref.read(triggerListProvider.notifier).add(trigger);
plausible.event(name: "Add Trigger", props: {"Type": triggerDefinition!.runtimeType.toString()});
plausible.event(name: "Add Trigger", props: {"Trigger Type": triggerDefinition!.runtimeType.toString()});
},
);
}
Expand Down Expand Up @@ -127,7 +127,7 @@ class _TriggersState extends ConsumerState<Triggers> {
setState(
() {
triggersList[index].enabled = value;
ref.read(triggerListProvider.notifier).store();
plausible.event(name: "Enable Trigger", props: {"Trigger Type": ref.read(triggerDefinitionListProvider).where((element) => element.uuid == triggersList[index].triggerDefUUID).first.toString()});
},
);
},
Expand Down

0 comments on commit 1e779ea

Please sign in to comment.