Metadata-Version: 2.1
Name: eques_elf
Version: 0.0.1
Summary: Eques Elf support for Python
Home-page: https://github.com/lgo/eques_elf
Author: Joey Pereira
Author-email: joey@pereira.io
License: UNKNOWN
Project-URL: Bug Tracker, https://github.com/lgo/eques_elf/issues
Keywords: eques elf,smart plug,iot,home assistant,hass
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Description-Content-Type: text/markdown
License-File: LICENSE

# Eques Elf python

Kudos to iamckn who has in-depth posts describing their work reverse engineering
the Eques Elf smart plug devices and has gocode alongside it, at https://github.com/iamckn/eques

This module is adapted from it to provide a Python module to be used in
HomeAssistant.

## Command line usage

See helpdoc for specific details.

### List devices

```sh
python src/main.py discover
```

```json
[
  {
    "ip": "10.0.0.123",
    "mac": "dc-4f-22-25-ab-cd",
    "password": "foobar",
    "state": true
  }
]
```

### Get status

```sh
python src/main.py send --cmd status --mac dc-4f-22-25-ab-cd --ip 10.0.0.123 --password foobar
```

```json
[
  {
    "ip": "10.0.0.123",
    "mac": "dc-4f-22-25-ab-cd",
    "password": "foobar",
    "state": true
  }
]
```

### Toggle device

_Toggle first fetches state (cmd: status) then sends a set command._

```sh
python src/main.py send --cmd toggle --mac dc-4f-22-25-ab-cd --ip 10.0.0.123 --password foobar
```

```json
[
  {
    "ip": "10.0.0.123",
    "mac": "dc-4f-22-25-ab-cd",
    "password": "foobar",
    "state": false
  }
]
```

### Set device on

```sh
python src/main.py send --cmd set_on --mac dc-4f-22-25-ab-cd --ip 10.0.0.123 --password foobar
```

```json
[
  {
    "ip": "10.0.0.123",
    "mac": "dc-4f-22-25-ab-cd",
    "password": "foobar",
    "state": false
  }
]
```

### Set device off

```sh
python src/main.py send --cmd set_off --mac dc-4f-22-25-ab-cd --ip 10.0.0.123 --password foobar
```

```json
[
  {
    "ip": "10.0.0.123",
    "mac": "dc-4f-22-25-ab-cd",
    "password": "foobar",
    "state": false
  }
]
```

## API

See `eques_local.py` and use:

- `discover_command`
- `status_command`
- `off_command`
- `on_command`

`device.Device` is used for carrying the device data.


