mirror of
https://github.com/nymea/nymea-plugins.git
synced 2026-07-18 00:43:48 +02:00
Merge remote-tracking branch 'origin/update-simulation'
This commit is contained in:
commit
d899246a7b
5
debian/control
vendored
5
debian/control
vendored
@ -653,7 +653,8 @@ Depends: nymea-plugin-awattar,
|
||||
nymea-plugin-wakeonlan,
|
||||
nymea-plugin-wemo,
|
||||
nymea-plugin-elgato,
|
||||
nymea-plugin-senic
|
||||
nymea-plugin-senic,
|
||||
nymea-plugin-keba,
|
||||
Replaces: guh-plugins
|
||||
Description: Plugins for nymea IoT server - the default plugin collection
|
||||
The nymea daemon is a plugin based IoT (Internet of Things) server. The
|
||||
@ -728,6 +729,8 @@ Package: nymea-plugins-all
|
||||
Section: libs
|
||||
Architecture: all
|
||||
Depends: nymea-plugins,
|
||||
nymea-plugin-simulation,
|
||||
nymea-plugin-snapd,
|
||||
nymea-plugins-433mhz,
|
||||
nymea-plugins-maker,
|
||||
nymea-plugins-merkurboard,
|
||||
|
||||
@ -234,8 +234,6 @@ DeviceManager::DeviceError DevicePluginSimulation::executeAction(Device *device,
|
||||
|
||||
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);
|
||||
// qCDebug(dcSimulation()) << "Generateed random int value: [" << min << ", " << max << "] -->" << value;
|
||||
return value;
|
||||
@ -276,7 +274,7 @@ void DevicePluginSimulation::onPluginTimer20Seconds()
|
||||
// Garden sensor
|
||||
device->setStateValue(gardenSensorTemperatureStateTypeId, generateRandomDoubleValue(20, 23));
|
||||
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(gardenSensorBatteryCriticalStateTypeId, device->stateValue(gardenSensorBatteryLevelStateTypeId).toDouble() <= 30);
|
||||
device->setStateValue(gardenSensorConnectedStateTypeId, true);
|
||||
|
||||
@ -763,12 +763,12 @@
|
||||
},
|
||||
{
|
||||
"id": "9781f0a5-3478-4291-ab51-9daa1ba0e44e",
|
||||
"name": "lightIntensity",
|
||||
"displayName": "Light intensity",
|
||||
"displayNameEvent": "Light intensity changed",
|
||||
"name": "illuminance",
|
||||
"displayName": "Illuminance",
|
||||
"displayNameEvent": "Illuminance changed",
|
||||
"type": "double",
|
||||
"unit": "Candela",
|
||||
"defaultValue": 0
|
||||
"unit": "Lux",
|
||||
"defaultValue": 20
|
||||
},
|
||||
{
|
||||
"id": "45c0de32-b519-47d7-9f82-e5f09d1542d4",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user