Skip to content

Commit

Permalink
Merge branch 'master' into readme
Browse files Browse the repository at this point in the history
# Conflicts:
#	demo/app/home/device-list/device-list-view-model.ts
  • Loading branch information
matey97 committed Aug 2, 2022
2 parents b6ed1b9 + e9a9c8b commit 4fb2c2d
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 145 deletions.
4 changes: 2 additions & 2 deletions demo/app/home/device-list/device-list-view-model.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Observable } from "@nativescript/core";
import { getLogger } from "~/home/logger/logger-view-model";
import { getNodeDiscoverer } from "nativescript-wearos-sensors/node";
import { getPlainMessageClient } from "../../../../src/internal/communication/plain-message";
import { getCollectorManager } from "nativescript-wearos-sensors/internal/collection";
import { getPlainMessageClient } from "nativescript-wearos-sensors/plain-message";
import { getCollectorManager } from "nativescript-wearos-sensors/collection";
import { getStore } from "~/home/store";

export class DeviceListViewModel extends Observable {
Expand Down
106 changes: 0 additions & 106 deletions demo/app/tests/internal/capability-discoverer.android.spec.ts

This file was deleted.

33 changes: 0 additions & 33 deletions src/internal/capability-discoverer.android.ts

This file was deleted.

3 changes: 3 additions & 0 deletions src/listeners/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { ListenerFilter as LF } from "../internal/sensor-listener-manager";
export { SensorListener } from "../internal/sensor-listener-manager";
export type ListenerFilter = LF;
12 changes: 8 additions & 4 deletions src/wearos-sensors.android.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Common, defaultConfig, WearosSensorsConfig } from './wearos-sensors.common';
import { allSensors, Common, defaultConfig, WearosSensorsConfig } from './wearos-sensors.common';

import { getCapabilityAdvertiserResultService } from "./internal/communication/capabilities/android/capability-advertiser-result-service.android";
import { getResultMessagingService } from "./internal/communication/messaging/android/messaging-result-service.android";
Expand All @@ -24,9 +24,13 @@ class WearosSensors extends Common {
public async init(config: WearosSensorsConfig = defaultConfig): Promise<void> {
this.wireUpCapabilityAdvertiser();

setEnabledSensors(config.sensors);
if (config.sensors && config.sensors.length > 0) {
this.wireUpSensorComponents(config.sensors);
const sensors = config.sensors
? config.sensors
: allSensors;

setEnabledSensors(sensors);
if (sensors.length > 0) {
this.wireUpSensorComponents(sensors);
}

if (!config.disableWearCommands) {
Expand Down

0 comments on commit 4fb2c2d

Please sign in to comment.