aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: 5bf92e1a277401da5ccb15b7a6c68d2d2181bedf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# lua-inverterd-client

[inverterd](https://github.com/gch1p/inverter-tools) client for Lua.

## Usage example

```lua
local inverter = require('inverter')
local json = require('json')

local inv = inverter.create('192.168.1.223', 8305)
local ok, err = inv:connect()

ok, status = inv:exec('get-status')
if not ok then
    print('error: ' .. status)
else
    status = json.decode(status)
    print(status.data.battery_voltage.value .. ' ' .. status.data.battery_voltage.unit)
end
```

## License

MIT