Skip to content

Commit

Permalink
Return state/lastupdated: "none", when it is not set
Browse files Browse the repository at this point in the history
  • Loading branch information
manup committed Mar 10, 2018
1 parent 1150cb9 commit db644c6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions rest_sensors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1484,6 +1484,13 @@ bool DeRestPluginPrivate::sensorToMap(const Sensor *sensor, QVariantMap &map, bo
if (strncmp(rid.suffix, "state/", 6) == 0)
{
const char *key = item->descriptor().suffix + 6;

if (rid.suffix == RStateLastUpdated && !item->lastSet().isValid())
{
state[key] = QLatin1String("none");
continue;
}

state[key] = item->toVariant();
}
}
Expand Down

0 comments on commit db644c6

Please sign in to comment.