Koenkk / zigbee-herdsman

A Node.js Zigbee library
MIT License
481 stars 300 forks source link

fix!: Fix always use `number` for `reportableChange` #1190

Closed Koenkk closed 2 months ago

Koenkk commented 2 months ago

reportableChange can be a number or [number, number] (to support larger ints). However since int40, uint48 and uint40 easily fit in a Node Number.MAX_SAFE_INTEGER there is no need to use [number, number].

uint48 max       = 281474976710655
MAX_SAFE_INTEGER = 9007199254740991

(u)int56 and (u)int64 could be supported through a BigInt, but in practice this will never be used.

This fixes https://github.com/Koenkk/zigbee2mqtt/issues/23711

TODO:

Koenkk commented 2 months ago

@Nerivec Done!

Nerivec commented 2 months ago

Made for a very nice cleanup in ZHC!