https://github.com/crusaider/leakbot-api
A thin wrapper to communicate with the Leakbot service over https.
https://github.com/crusaider/leakbot-api
Last synced: 3 months ago
JSON representation
A thin wrapper to communicate with the Leakbot service over https.
- Host: GitHub
- URL: https://github.com/crusaider/leakbot-api
- Owner: crusaider
- License: mit
- Created: 2024-06-26T18:47:24.000Z (12 months ago)
- Default Branch: master
- Last Pushed: 2025-02-01T16:08:51.000Z (4 months ago)
- Last Synced: 2025-02-28T15:01:35.464Z (3 months ago)
- Language: TypeScript
- Size: 79.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Leakbot API
A thin wrapper to communicate with the [**Leakbot**](https://leakbot.io/) service over https.
Should be possible to use this library in both node.js and the browser.
## Credits and inspiration
This library is basically a Typescript implementation of the API layer in the home [assistant leakbot integration](https://github.com/sHedC/homeassistant-leakbot).
## Installation
```bash
npm install @crusaider/leakbot-api
```## Usage
```typescript
import { connect } from '@crusaider/leakbot-api';const client = await connect({
username: '',
password: '',
});console.log(await client.listUserDevices());
```## API
### connect
```typescript
connect(options: {
username: string;
password: string;
}): Promise;
```### LeakbotClient
```typescript
interface LeakbotAPI {
listUserDevices(): Promise;
getUserAccountInfo(): Promise;
listUserAddresses(): Promise;
getUserTenant(): Promise;
getDeviceStatus(deviceId: DeviceId): Promise;
listDevicesMessages(deviceId: DeviceId): Promise;
getDeviceWaterUsage(
deviceId: DeviceId,
timeZoneOffset?: number
): Promise;
}
```## Please Read
> :warning: **Leakbot Only Allows One Login:** If you use this library the token your mobile app is connected to becomes invalid and you get logged out. This happens also if you re-log back into the app it invalidates the token for the integration, however the library should automatically re-authenticate.