Skip to content

Commit

Permalink
Handle ext address > 2^63 -1
Browse files Browse the repository at this point in the history
  • Loading branch information
ebaauw committed Dec 2, 2024
1 parent 7ad5f9c commit 5f8762a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
10 changes: 9 additions & 1 deletion rest_lights.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,15 @@ bool DeRestPluginPrivate::lightToMap(const ApiRequest &req, LightNode *lightNode

const ApiAttribute a = rid.toApi(map, event);
QVariantMap *p = a.map;
(*p)[a.key] = item->toVariant();
if (rid.suffix == RAttrExtAddress)
{
const quint64 value = item->toNumber();
(*p)[a.key] = value;
}
else
{
(*p)[a.key] = item->toVariant();
}

if (event && item->needPushChange())
{
Expand Down
10 changes: 9 additions & 1 deletion rest_sensors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2687,7 +2687,15 @@ bool DeRestPluginPrivate::sensorToMap(Sensor *sensor, QVariantMap &map, const Ap

const ApiAttribute a = rid.toApi(map, event);
QVariantMap *p = a.map;
(*p)[a.key] = item->toVariant();
if (rid.suffix == RAttrExtAddress)
{
const quint64 value = item->toNumber();
(*p)[a.key] = value;
}
else
{
(*p)[a.key] = item->toVariant();
}

if (event && item->needPushChange())
{
Expand Down

0 comments on commit 5f8762a

Please sign in to comment.