Skip to content

Commit 8c23a7a

Browse files
committed
Added missing DPT
1 parent a683fb7 commit 8c23a7a

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

knx/dpt/types.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ type DatapointValue interface {
1717
Unpack(data []byte) error
1818
}
1919

20-
// DatapointMeta gives meta information about a datapoint type.
20+
// DatapointMeta gives meta information about a datapoint.
2121
type DatapointMeta interface {
2222
// Unit returns the unit of this datapoint type or empty string if it doesn't have a unit.
2323
Unit() string

knx/dpt/types_registry.go

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Copyright 2020 Sven Rebhan.
2-
// Copyright 2022 Martin Müller.
2+
// Copyright 2024 Martin Müller.
33
// Licensed under the MIT license which can be found in the LICENSE file.
44

55
package dpt
@@ -29,6 +29,9 @@ var dptTypes = map[string]Datapoint{
2929
"1.017": new(DPT_1017),
3030
"1.018": new(DPT_1018),
3131
"1.019": new(DPT_1019),
32+
"1.021": new(DPT_1021),
33+
"1.022": new(DPT_1022),
34+
"1.023": new(DPT_1023),
3235
"1.024": new(DPT_1024),
3336
"1.100": new(DPT_1100),
3437

@@ -255,10 +258,12 @@ func ListSupportedTypes() []string {
255258
return keys
256259
}
257260

258-
// Produce returns an uninitialized instance of the given datapoint name, e.g. "1.001".
261+
// Produce returns an uninitialized instance, given the exact datapoint name.
262+
// It returns a DPT_1001 for "1.001".
259263
func Produce(name string) (d Datapoint, ok bool) {
260264
// Lookup the given type and return a datapoint of that type.
261265
x, ok := dptTypes[name]
266+
262267
if ok {
263268
d_type := reflect.TypeOf(x).Elem()
264269
d = reflect.New(d_type).Interface().(Datapoint)

0 commit comments

Comments
 (0)