Skip to content

Commit

Permalink
Added new commands hasProperty, hasCommand and getCommands to D…
Browse files Browse the repository at this point in the history
…evice and Station

schemaVersion has now been applied to the events and supported commands as well
Updated dependency eufy-security-client
  • Loading branch information
bropat committed Jul 23, 2021
1 parent 2d0ef96 commit f0379ef
Show file tree
Hide file tree
Showing 19 changed files with 1,039 additions and 2,590 deletions.
4 changes: 2 additions & 2 deletions API_SCHEMA.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ Base schema.

## Schema 3

* Added new commands `triggerAlarm`, `resetAlarm`, `panAndTilt`, `quickResponse`, `startDownload`, `cancelDownload` and `getVoices` to Device
* Added new commands `triggerAlarm`, `resetAlarm`, `panAndTilt`, `quickResponse`, `startDownload`, `cancelDownload`, `getVoices`, `hasProperty`, `hasCommand` and `getCommands` to Device
* Added new commands `getAlarmEvents`, `getVideoEvents` and `getHistoryEvents` to Driver
* Renamed commands `isConnected` and `isPushConnected` to Driver
* Added new Device events `downloadStarted`,`downloadFinished`, `downloadVideoData` and `downloadAudioData`
* Added new properties `motionDetectionType`, `motionDetectionSensivity`, `motionTracking`, `soundDetectionType`, `soundDetectionSensivity`, `light`, `microphone`, `speaker`, `speakerVolume`, `ringtoneVolume`, `audioRecording`, `powerSource`, `powerWorkingMode`, `recordingEndClipMotionStops`, `recordingClipLength`, `recordingRetriggerInterval`, `videoStreamingQuality`, `videoRecordingQuality`, `videoWDR`, `lightSettingsEnable`, `lightSettingsBrightnessManual`, `lightSettingsBrightnessMotion`, `lightSettingsBrightnessSchedule`, `lightSettingsMotionTriggered`, `lightSettingsMotionTriggeredDistance`, `lightSettingsMotionTriggeredTimer`, `chimeIndoor`, `chimeHomebase`, `chimeHomebaseRingtoneVolume`, `chimeHomebaseRingtoneType`, `notificationType`, `rotationSpeed`, `notificationPerson`, `notificationPet`, `notificationAllOtherMotion`, `notificationCrying`, `notificationAllSound`, `notificationIntervalTime`, `notificationRing` and `notificationMotion` to Device
* Added new Station events `currentModeChanged` and `alarmEvent`
* Added new commands `triggerAlarm` and `resetAlarm` to Station
* Added new commands `triggerAlarm`, `resetAlarm`, `hasProperty`, `hasCommand` and `getCommands` to Station
* Added new properties `timeFormat`, `alarmVolume`, `alarmTone`, `promptVolume`, `notificationSwitchModeSchedule`, `notificationSwitchModeGeofence`, `notificationSwitchModeApp`, `notificationSwitchModeKeypad` and `notificationStartAlarmDelay` to Station
* Added new error codes `deviceInvalidProperty`, `deviceInvalidPropertyValue`, `devicePropertyNotSupported`, `deviceReadOnlyProperty`, `deviceNotSupported`, `deviceInvalidCommandValue`, `deviceLivestreamAlreadyRunning`, `deviceLivestreamNotRunning`, `schemaIncompatible`, `invalidCountryCode` and `invalidLanguageCode`
126 changes: 125 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,68 @@ interface {
}
```

#### Get supported commands

[compatible with schema version: 3+]

```ts
interface {
messageId: string;
command: "station.get_commands";
serialNumber: string;
}
```

Returns:

```ts
interface {
commands: Array<CommandName>;
}
```

#### Check command name

[compatible with schema version: 3+]

```ts
interface {
messageId: string;
command: "station.has_command";
serialNumber: string;
commandName: string;
}
```

Returns:

```ts
interface {
exists: boolean;
}
```

#### Check property name

[compatible with schema version: 3+]

```ts
interface {
messageId: string;
command: "station.has_property";
serialNumber: string;
propertyName: string;
}
```

Returns:

```ts
interface {
exists: boolean;
}
```

### Device level commands

#### Get properties metadata
Expand Down Expand Up @@ -801,6 +863,68 @@ interface {
}
```

#### Get supported commands

[compatible with schema version: 3+]

```ts
interface {
messageId: string;
command: "device.get_commands";
serialNumber: string;
}
```

Returns:

```ts
interface {
commands: Array<CommandName>;
}
```

#### Check command name

[compatible with schema version: 3+]

```ts
interface {
messageId: string;
command: "device.has_command";
serialNumber: string;
commandName: string;
}
```

Returns:

```ts
interface {
exists: boolean;
}
```

#### Check property name

[compatible with schema version: 3+]

```ts
interface {
messageId: string;
command: "device.has_property";
serialNumber: string;
propertyName: string;
}
```

Returns:

```ts
interface {
exists: boolean;
}
```

## Events

### Driver level events
Expand Down Expand Up @@ -958,7 +1082,7 @@ interface {
source: "station";
event: "guard mode changed";
serialNumber: string;
currentMode: number; //Removed in schema version 3+
currentMode: number; // Removed in schema version 3+, as there is now a separate event
guardMode: number;
}
}
Expand Down
Loading

0 comments on commit f0379ef

Please sign in to comment.