get_hub_info()
- Get hub information.
Edit
Edit
- none
Edit
| field | type | description |
|---|---|---|
| model | string | Production name |
| architecture | string | SOC architecture |
| firmware | string | Firmware version |
| kernel | string | Kernel version (for atom32 ESP-SDK version used) |
| hardware | string | Hardware version |
| serial | string | Serial number |
| location | JsonObj | Location information |
| location.latitude | float32 | Latitude value |
| location.longitude | float32 | Longitude value |
| location.timezone | string | Time zone name. Can be empty on internal error. Check logs on the hub for the error message ( for H2) |
| location.state | string | Can contain one of possible values: , , , |
| build | JsonObj | Build info |
| build.time | string | Time and date when the build was made (ISO 8601: YYYY-MM-DDThh:mm:ss±hhmm) |
| build.builder | string | Where the firmware was builded (user@host) |
| build.branch | string | Branch name |
| build.commit | string | Commit hash |
| battery | object | If controller have no battery support whole section is not returned |
| battery.status | enum | , , , , |
| battery.charge_state | int | Percent of available battery capacity |
| battery.remaining_time | int | Remaining time in minutes to empty if discharging, or to full if charging |
| battery.health | int | Percent of current full capacity relative to original full capacity |
| uptime | string | Hub uptime |
| localtime | string | Current time on hub (ISO 8601: YYYY-MM-DDThh:mm:ss±hhmm) |
Edit
local core = require "core"
local info = core.get_hub_info()
print( info )