fix W1 range

This commit is contained in:
2026-02-23 01:35:26 +01:00
parent e115106b2b
commit 6df2073174
3 changed files with 3 additions and 3 deletions

View File

@@ -164,7 +164,7 @@ func isReadableParamID(id int) bool {
// validateParamRange checks if value is within acceptable range for parameter
func validateParamRange(id, value int) bool {
ranges := map[int][2]int{
1: {0, 255}, // W1 - Min Threshold
1: {0, 2000}, // W1 - Min Threshold
2: {0, 4095}, // W2 - Max Threshold
3: {1, 50}, // W3 - Pulse Count
4: {1000, 60000},// W4 - Time Window

View File

@@ -35,7 +35,7 @@ func NewDeviceState() *DeviceState {
alarmActive: false,
alarmType: "",
params: map[int]int{
1: 127, // W1 - Min Threshold (middle of 0-255)
1: 1200, // W1 - Min Threshold (default as per docs)
2: 2047, // W2 - Max Threshold (middle of 0-4095)
3: 25, // W3 - Pulse Count (middle of 1-50)
4: 30500, // W4 - Time Window (middle of 1000-60000)

View File

@@ -155,7 +155,7 @@ func (m Model) renderControlsPanel(width int) string {
20: "W20 (Gain)",
}
paramRanges := map[int][2]int{
1: {0, 255},
1: {0, 2000},
2: {0, 4095},
3: {1, 50},
4: {1000, 60000},