nicer code

This commit is contained in:
uli 2022-05-30 15:37:32 +02:00
parent e10697448c
commit ee06b34281

View File

@ -725,7 +725,7 @@ func (i *Device) SetTimezone(t time.Time) error {
dst := 0 dst := 0
if t.IsDST() { if t.IsDST() {
dst = 3600 dst = 3600
offset = offset - 3600 offset -= 3600
} }
buf := &bytes.Buffer{} buf := &bytes.Buffer{}
binary.Write(buf, binary.LittleEndian, uint8(offset / 3600 * 4)) binary.Write(buf, binary.LittleEndian, uint8(offset / 3600 * 4))