diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..da16959 --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +persistent.json + +# NPM +node_modules + +# Bun +bun.lockb diff --git a/index.ts b/index.ts new file mode 100644 index 0000000..690015a --- /dev/null +++ b/index.ts @@ -0,0 +1,15 @@ +import { EufySecurity, P2PConnectionType } from "eufy-security-client"; + +const eufySecurity = await EufySecurity.initialize({ + username: 'test', + password: 'test', + country: 'CZ', + language: 'en', + eventDurationSeconds: 60, + p2pConnectionSetup: P2PConnectionType.QUICKEST, + pollingIntervalMinutes: 1, +}); + +// Make `persistent.json` to avoid crash #1 +// Note that Bun doesn't support Git leading to crash #2 +// See https://github.com/oven-sh/bun/pull/4395 diff --git a/package.json b/package.json new file mode 100644 index 0000000..38c8cdd --- /dev/null +++ b/package.json @@ -0,0 +1,6 @@ +{ + "dependencies": { + "@types/bun": "^1.0.8", + "eufy-security-client": "^3.0.0" + } +} \ No newline at end of file diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..2400c48 --- /dev/null +++ b/readme.md @@ -0,0 +1,15 @@ +# Eufy Doorbell Snapshotter + +This repository contains my effort to write a script to periodically take snaps +from my Eufy doorbell for timelapse video production purposes. + +I am trying to use the https://github.com/bropat/eufy-security-client library, +but it depends on `mqtt` which doesn't work with Vite (version 1 of me trying +this that I have removed but is still in the Git history) and `got` which is not +supported by Bun at the moment: https://github.com/oven-sh/bun/pull/4395. + +I don't want to be touching Node anymore so I'll wait for either MQTT to fix the +ESM export or for Bun to fix the `got` support. + +The library uses Got for HTTP2 which I don't think native `fetch` supports so I +don't think there is a path to drop the dep.