Skip to content

Commit

Permalink
Fixed parse property values in client calling set_property of device …
Browse files Browse the repository at this point in the history
…or station (#29)

Added support for new Homebase 3 (#139)
Added support to add/delete/modify smart lock users
Added support for smart safes
Added support for eufyCam 3 and eufyCam 3C
Implemented #124
Fixed issue #135
Fixed issue #127
Updated dependency eufy-security-client to 2.2.0
Updated dependency commander to 9.4.1
Updated dependency ws to 8.10.0
Updated dev dependencies
  • Loading branch information
bropat committed Nov 1, 2022
1 parent 473f0d7 commit 29ae66c
Show file tree
Hide file tree
Showing 18 changed files with 1,057 additions and 287 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.0.0-rc.1</small>
# eufy-security-ws <small>1.0.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
103 changes: 103 additions & 0 deletions docs/api_cmds.md
Original file line number Diff line number Diff line change
Expand Up @@ -941,6 +941,109 @@ interface {
}
```

### Add User

[compatible with schema version: 13+]

```ts
interface {
messageId: string;
command: "device.add_user";
serialNumber: string;
username: string;
passcode: string;
schedule?: Schedule;
}
```

### Delete User

[compatible with schema version: 13+]

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

### Get Users

[compatible with schema version: 13+]

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

Returns:

```ts
interface {
users: Array<User>;
}
```

### Update User Username

[compatible with schema version: 13+]

```ts
interface {
messageId: string;
command: "device.update_user";
serialNumber: string;
username: string;
newUsername: string;
}
```

### Update User Passcode

[compatible with schema version: 13+]

```ts
interface {
messageId: string;
command: "device.update_user_passcode";
serialNumber: string;
username: string;
passcode: string;
}
```

### Update User Schedule

[compatible with schema version: 13+]

```ts
interface {
messageId: string;
command: "device.update_user_schedule";
serialNumber: string;
username: string;
schedule: Schedule;
}
```

### Verify PIN

[compatible with schema version: 13+]

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

### Enable/disable status led

[compatible with schema version: 0-12]
Expand Down
129 changes: 129 additions & 0 deletions docs/api_events.md
Original file line number Diff line number Diff line change
Expand Up @@ -1416,4 +1416,133 @@ interface {
serialNumber: string;
}
}
```

### `user added`

[compatible with schema version: 13+]

This event is sent whenever a new user is successfully added to a lock device.

```ts
interface {
type: "event";
event: {
source: "device";
event: "user added";
serialNumber: string;
username: string;
schedule?: Schedule;
}
}
```

### `user deleted`

[compatible with schema version: 13+]

This event is sent whenever a user is successfully delete from a lock device.

```ts
interface {
type: "event";
event: {
source: "device";
event: "user deleted";
serialNumber: string;
username: string;
}
}
```

### `user error`

[compatible with schema version: 13+]

This event is sent whenever during a user action (add/delete/modify), for a lock device, an error occured.

```ts
interface {
type: "event";
event: {
source: "device";
event: "user error";
serialNumber: string;
username: string;
error: Error;
}
}
```

### `user username updated`

[compatible with schema version: 13+]

This event is sent whenever a username is successfully changed for a lock device.

```ts
interface {
type: "event";
event: {
source: "device";
event: "user username updated";
serialNumber: string;
username: string;
}
}
```

### `user schedule updated`

[compatible with schema version: 13+]

This event is sent whenever a user schedule is successfully changed for a lock device.

```ts
interface {
type: "event";
event: {
source: "device";
event: "user schedule updated";
serialNumber: string;
username: string;
schedule: Schedule;
}
}
```

### `user passcode updated`

[compatible with schema version: 13+]

This event is sent whenever a user passcode is successfully changed for a lock device.

```ts
interface {
type: "event";
event: {
source: "device";
event: "user passcode updated";
serialNumber: string;
username: string;
}
}
```

### `pin verified`

[compatible with schema version: 13+]

This event is sent whenever a pin verification for a smart safe was requested.

```ts
interface {
type: "event";
event: {
source: "device";
event: "pin verified";
serialNumber: string;
successfull: boolean;
}
}
```
4 changes: 2 additions & 2 deletions docs/api_schema_versions.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ This document describes the changes that are introduced with each schema version
* Modified Device event `command result` adding custom data
* Modified Station commands `get_properties` and `get_properties_metadata` to only return supported properties (schema versioned)
* Modified Device commands `get_properties` and `get_properties_metadata` to only return supported properties (schema versioned)
* Added new Device events `locked`, `package delivered` , `package stranded`, `package taken`, `someone loitering`, `radar motion detected`, `alarm 911`, `shake alarm`, `wrong try-protect alarm`, `long time not close`, `low battery`, `jammed`, `talkback started` and `talkback stopped`
* Added new commands `snooze`, `unlock`, `is_downloading`, `start_talkback`, `stop_talkback`, `is_talkback_ongoing` and `talkback_audio_data` to Device
* Added new Device events `locked`, `package delivered` , `package stranded`, `package taken`, `someone loitering`, `radar motion detected`, `alarm 911`, `shake alarm`, `wrong try-protect alarm`, `long time not close`, `low battery`, `jammed`, `talkback started`, `talkback stopped`, `user added`, `user deleted`, `user error`, `user username updated`, `user schedule updated`, `user passcode updated` and `pin verified`
* Added new commands `snooze`, `unlock`, `is_downloading`, `start_talkback`, `stop_talkback`, `is_talkback_ongoing`, `talkback_audio_data`, `add_user`, `delete_user`, `get_users`, `device.update_user_passcode`, `device.update_user_schedule`, `device.update_user` and `device.verify_pin` to Device
* Removed deprecated commands `set_status_led`, `set_auto_night_vision`, `set_motion_detection`, `set_sound_detection`, `set_pet_detection`, `set_rtsp_stream`, `set_anti_theft_detection`, `set_watermark`, `enable_device` and `lock_device` to Device. Please use instead `set_property` command.
* Changed `start_listening` response to only list station and device serial numbers (removed all properties). Please use now appropiate calls for getting properties (`get_properties` etc.)
* Device events `device added` and `device removed` only returns the device serial number (no more all properties of the device)
Expand Down
Loading

0 comments on commit 29ae66c

Please sign in to comment.