vapourismo / knx-go

KNX clients and protocol implementation in Go
MIT License
91 stars 59 forks source link

All DPT1.xxx are boolean #81

Closed userwithoutpassword closed 8 months ago

userwithoutpassword commented 8 months ago

Why are there Strings defined like "On" "Off" or "Up" "Down"

`// DPT_1001 represents DPT 1.001 (G) / DPT_Switch. type DPT_1001 bool

func (d DPT_1001) Pack() []byte { return []byte{packB1(bool(d))} }

func (d DPT_1001) Unpack(data []byte) error { return unpackB1(data, (bool)(d)) }

func (d DPT_1001) Unit() string { return "" }

func (d DPT_1001) String() string { if d { return "On" } else { return "Off" } }`

but in influxdb all DPT1.xxx are boolean with values "true" oder "false"

I would expect seeing these Strings filled into the field "_value"

mobilarte commented 8 months ago

Datapoint Types are defined in the KNX -> System Specifications -> Internetworking -> Datapoint Types.

The documents can be downloaded here.

userwithoutpassword commented 8 months ago

Thats not the question. The Question ist why defining these Strings inside knx-go and dont using them?

mobilarte commented 8 months ago

I think you completely misunderstand what knx-go does.

The code that is using knx-go is here, the KNX Input Plugin used by telegraf.

You should ask them, not here!

userwithoutpassword commented 8 months ago

ok thx