Merge remote-tracking branch 'origin/update-simulation'

This commit is contained in:
Jenkins 2018-03-26 11:42:07 +02:00
commit d899246a7b
3 changed files with 10 additions and 9 deletions

5
debian/control vendored
View File

@ -653,7 +653,8 @@ Depends: nymea-plugin-awattar,
nymea-plugin-wakeonlan, nymea-plugin-wakeonlan,
nymea-plugin-wemo, nymea-plugin-wemo,
nymea-plugin-elgato, nymea-plugin-elgato,
nymea-plugin-senic nymea-plugin-senic,
nymea-plugin-keba,
Replaces: guh-plugins Replaces: guh-plugins
Description: Plugins for nymea IoT server - the default plugin collection Description: Plugins for nymea IoT server - the default plugin collection
The nymea daemon is a plugin based IoT (Internet of Things) server. The The nymea daemon is a plugin based IoT (Internet of Things) server. The
@ -728,6 +729,8 @@ Package: nymea-plugins-all
Section: libs Section: libs
Architecture: all Architecture: all
Depends: nymea-plugins, Depends: nymea-plugins,
nymea-plugin-simulation,
nymea-plugin-snapd,
nymea-plugins-433mhz, nymea-plugins-433mhz,
nymea-plugins-maker, nymea-plugins-maker,
nymea-plugins-merkurboard, nymea-plugins-merkurboard,

View File

@ -234,8 +234,6 @@ DeviceManager::DeviceError DevicePluginSimulation::executeAction(Device *device,
int DevicePluginSimulation::generateRandomIntValue(int min, int max) int DevicePluginSimulation::generateRandomIntValue(int min, int max)
{ {
// Seed the random generator with current time
qsrand(QDateTime::currentMSecsSinceEpoch() / 1000);
int value = ((qrand() % ((max + 1) - min)) + min); int value = ((qrand() % ((max + 1) - min)) + min);
// qCDebug(dcSimulation()) << "Generateed random int value: [" << min << ", " << max << "] -->" << value; // qCDebug(dcSimulation()) << "Generateed random int value: [" << min << ", " << max << "] -->" << value;
return value; return value;
@ -276,7 +274,7 @@ void DevicePluginSimulation::onPluginTimer20Seconds()
// Garden sensor // Garden sensor
device->setStateValue(gardenSensorTemperatureStateTypeId, generateRandomDoubleValue(20, 23)); device->setStateValue(gardenSensorTemperatureStateTypeId, generateRandomDoubleValue(20, 23));
device->setStateValue(gardenSensorSoilMoistureStateTypeId, generateRandomIntValue(40, 60)); device->setStateValue(gardenSensorSoilMoistureStateTypeId, generateRandomIntValue(40, 60));
device->setStateValue(gardenSensorLightIntensityStateTypeId, generateRandomIntValue(40, 60)); device->setStateValue(gardenSensorIlluminanceStateTypeId, generateRandomIntValue(20, 80));
device->setStateValue(gardenSensorBatteryLevelStateTypeId, generateRandomIntValue(25, 90)); device->setStateValue(gardenSensorBatteryLevelStateTypeId, generateRandomIntValue(25, 90));
device->setStateValue(gardenSensorBatteryCriticalStateTypeId, device->stateValue(gardenSensorBatteryLevelStateTypeId).toDouble() <= 30); device->setStateValue(gardenSensorBatteryCriticalStateTypeId, device->stateValue(gardenSensorBatteryLevelStateTypeId).toDouble() <= 30);
device->setStateValue(gardenSensorConnectedStateTypeId, true); device->setStateValue(gardenSensorConnectedStateTypeId, true);

View File

@ -763,12 +763,12 @@
}, },
{ {
"id": "9781f0a5-3478-4291-ab51-9daa1ba0e44e", "id": "9781f0a5-3478-4291-ab51-9daa1ba0e44e",
"name": "lightIntensity", "name": "illuminance",
"displayName": "Light intensity", "displayName": "Illuminance",
"displayNameEvent": "Light intensity changed", "displayNameEvent": "Illuminance changed",
"type": "double", "type": "double",
"unit": "Candela", "unit": "Lux",
"defaultValue": 0 "defaultValue": 20
}, },
{ {
"id": "45c0de32-b519-47d7-9f82-e5f09d1542d4", "id": "45c0de32-b519-47d7-9f82-e5f09d1542d4",