mirror of
https://github.com/Luzifer/tasmota-config.git
synced 2024-11-12 16:42:42 +00:00
Add reader for CurrentCal, PowerCal and VoltageCal
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
c93c521a7a
commit
9ac7aa8c6b
1 changed files with 3 additions and 0 deletions
|
@ -12,13 +12,16 @@ import (
|
||||||
type settingExtractor func([]byte) (interface{}, error)
|
type settingExtractor func([]byte) (interface{}, error)
|
||||||
|
|
||||||
var extractors = map[string]settingExtractor{
|
var extractors = map[string]settingExtractor{
|
||||||
|
"currentcal": func(p []byte) (interface{}, error) { return extractFloatToInt("CurrentCal", p) },
|
||||||
"devicename": func(p []byte) (interface{}, error) { return extractGenericJSONValue("DeviceName", p) },
|
"devicename": func(p []byte) (interface{}, error) { return extractGenericJSONValue("DeviceName", p) },
|
||||||
"ledstate": func(p []byte) (interface{}, error) { return extractFloatToInt("LedState", p) },
|
"ledstate": func(p []byte) (interface{}, error) { return extractFloatToInt("LedState", p) },
|
||||||
"module": extractModule,
|
"module": extractModule,
|
||||||
"otaurl": func(p []byte) (interface{}, error) { return extractGenericJSONValue("OtaUrl", p) },
|
"otaurl": func(p []byte) (interface{}, error) { return extractGenericJSONValue("OtaUrl", p) },
|
||||||
|
"powercal": func(p []byte) (interface{}, error) { return extractFloatToInt("PowerCal", p) },
|
||||||
"teleperiod": func(p []byte) (interface{}, error) { return extractFloatToInt("TelePeriod", p) },
|
"teleperiod": func(p []byte) (interface{}, error) { return extractFloatToInt("TelePeriod", p) },
|
||||||
"timezone": func(p []byte) (interface{}, error) { return extractGenericJSONValue("Timezone", p) },
|
"timezone": func(p []byte) (interface{}, error) { return extractGenericJSONValue("Timezone", p) },
|
||||||
"topic": func(p []byte) (interface{}, error) { return extractGenericJSONValue("Topic", p) },
|
"topic": func(p []byte) (interface{}, error) { return extractGenericJSONValue("Topic", p) },
|
||||||
|
"voltagecal": func(p []byte) (interface{}, error) { return extractFloatToInt("VoltageCal", p) },
|
||||||
}
|
}
|
||||||
|
|
||||||
func extractSettingValue(setting string, payloadChan chan []byte) (interface{}, error) {
|
func extractSettingValue(setting string, payloadChan chan []byte) (interface{}, error) {
|
||||||
|
|
Loading…
Reference in a new issue