Skip to content

Commit

Permalink
Incremented schema version to 18
Browse files Browse the repository at this point in the history
Added new commands `database_query_latest_info`, `database_query_local` , `database_count_by_date` and `database_delete` to Station
Added new Station events `database query latest`, `database query local`, `station.database_count_by_date` and `station.database_delete`
Implemented feature request #180
Updated dependency eufy-security-client to 2.6.0
Updated dependency ws to 8.13.0
Added dependency date-and-time to 3.0.0
Updated dev dependencies
Updated docs
  • Loading branch information
bropat committed May 12, 2023
1 parent 0cef884 commit a6077f3
Show file tree
Hide file tree
Showing 15 changed files with 575 additions and 173 deletions.
2 changes: 1 addition & 1 deletion docs/_coverpage.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
![logo](_media/eufy-security-ws.png)

# eufy-security-ws <small>1.4.1</small>
# eufy-security-ws <small>1.5.0</small>

> A small server wrapper around [eufy-security-client](https://github.com/bropat/eufy-security-client) library to access it via a WebSocket
Expand Down
56 changes: 56 additions & 0 deletions docs/api_cmds.md
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,62 @@ interface {
}
```

### Database Query Latest Info

[compatible with schema version: 18+]

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

### Database Query Local

[compatible with schema version: 18+]

```ts
interface {
messageId: string;
command: "station.database_query_local";
serialNumber: string;
startDate: Date;
endDate: Date;
eventType?: FilterEventType;
detectionType?: FilterDetectType;
storageType?: FilterStorageType;
}
```

### Database Count By Date

[compatible with schema version: 18+]

```ts
interface {
messageId: string;
command: "station.database_count_by_date";
serialNumber: string;
startDate: Date;
endDate: Date;
}
```

### Database Delete

[compatible with schema version: 18+]

```ts
interface {
messageId: string;
command: "station.database_delete";
serialNumber: string;
ids: Array<number>;
}
```

## Device level commands

### Get properties metadata
Expand Down
76 changes: 76 additions & 0 deletions docs/api_events.md
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,82 @@ interface {
}
```

### `database query latest`

[compatible with schema version: 18+]

This event is sent as a result of the command `station.database_query_latest_info`.

```ts
interface {
type: "event";
event: {
source: "station";
event: "database query latest";
serialNumber: string;
returnCode: DatabaseReturnCode;
data: Array<DatabaseQueryLatestInfo>
}
}
```

### `database query local`

[compatible with schema version: 18+]

This event is sent as a result of the command `station.database_query_local`.

```ts
interface {
type: "event";
event: {
source: "station";
event: "database query local";
serialNumber: string;
returnCode: DatabaseReturnCode;
data: Array<DatabaseQueryLocal>
}
}
```

### `database count by date`

[compatible with schema version: 18+]

This event is sent as a result of the command `station.database_count_by_date`.

```ts
interface {
type: "event";
event: {
source: "station";
event: "database count by date";
serialNumber: string;
returnCode: DatabaseReturnCode;
data: Array<DatabaseCountByDate>
}
}
```

### `database delete`

[compatible with schema version: 18+]

This event is sent as a result of the command `station.database_delete`.

```ts
interface {
type: "event";
event: {
source: "station";
event: "database delete";
serialNumber: string;
returnCode: DatabaseReturnCode;
failedIds: Array<unknown>;
}
}
```

## Device level events

### `device added`
Expand Down
5 changes: 5 additions & 0 deletions docs/api_schema_versions.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

This document describes the changes that are introduced with each schema version.

## Schema 18

* Added new commands `database_query_latest_info`, `database_query_local` , `database_count_by_date` and `database_delete` to Station
* Added new Station events `database query latest`, `database query local`, `station.database_count_by_date` and `station.database_delete`

## Schema 17

* Added new property `picture` to Device
Expand Down
Loading

0 comments on commit a6077f3

Please sign in to comment.