Commit Graph

65 Commits (ecaa0c8dc5616d15ea2791770cf89ea1d6592cca)

Author SHA1 Message Date
Simon Stürz ecaa0c8dc5 Update discovery and action timeouts and make JSONRPC timeout the last timeout 2022-07-21 16:27:11 +02:00
Michael Zanetti db65beb202 Migrate pluginid in thing settings when a thing class moves between plugins 2022-05-13 11:27:21 +02:00
Jenkins nymea d83fed97d8 Merge PR #496: Don't generate events for state changes any more 2022-03-27 19:49:32 +02:00
Michael Zanetti 7bfb48feac Split thing state cache into individual files 2022-02-09 12:04:08 +01:00
Michael Zanetti 2a91dad1f0 Don't generate events for state changes any more
Up until now, nymea would generate EventTypes for every StateType
as well as emit an Event (along with a StateChanged notification) for
every change. This results in a lot of duplicated network traffic
which is of not much use. The StateChanged notification contains
all the information in the Event too and nymea:app actually never
really used Events for state changes.

This commit removes the events from the ThingClass, making it a lot
smaller and stops emitting Events for state changes.

As this is breaking the behavior, the JSONRPC API major version
is bumped.
2022-02-08 10:38:41 +01:00
Michael Zanetti df5d3550ba Add support for dynamic min/max state values 2021-12-09 17:59:52 +01:00
Michael Zanetti 59011c0387 Add PluginTimer API to python plugins 2021-08-26 14:15:43 +02:00
Michael Zanetti 1e008fd60d Fix erraneous state changes during thing setup 2021-05-19 16:11:31 +02:00
Jenkins nymea a81b484635 Merge PR #396: Don't call thingRemoved() when a thing didn't complete the setup 2021-04-19 11:38:17 +02:00
Jenkins nymea 2050ac23cb Merge PR #382: Silence plugin dir debug print 2021-02-25 11:27:05 +01:00
Michael Zanetti dab8764584 Refresh setup status before proceeding 2021-02-24 17:42:16 +01:00
Michael Zanetti b2f9e911ad Don't cal thingRemoved() when a thing didn't complete the setup 2021-02-20 22:56:57 +01:00
Michael Zanetti a95b2de303 Silence plugin dir debug print
This is printed before logging filters are set because it's needed
for generating the --help text. There shouldn't be a debug print at
this place yet.
2021-01-09 11:48:59 +01:00
Michael Zanetti 3fb74cc9e4 Add API to configure logging/filtering by the client 2021-01-04 16:43:28 +01:00
Michael Zanetti 32eb6d6dd7 tune filter 2021-01-03 21:58:10 +01:00
Michael Zanetti eeb1feade0 Add a jitter filtering mechanism 2021-01-02 14:33:15 +01:00
Michael Zanetti ae38e185b6 more work... not really working yet 2021-01-02 14:33:15 +01:00
Michael Zanetti d1b57be370 Make python plugins optional during the build process 2020-11-30 20:00:04 +01:00
Jenkins nymea c956988f32 Merge PR #341: Add an API keys provider plugin mechanism 2020-10-28 19:07:39 +01:00
Jenkins nymea 694b070f05 Merge PR #310: Add support for Python plugins 2020-10-28 19:07:25 +01:00
Jenkins nymea db98f60556 Merge PR #309: Don't call thingRemoved() on the plugin in case of reconfiguring 2020-10-28 19:07:24 +01:00
Michael Zanetti dcae305625 Add an API keys provider plugin mechanism 2020-10-20 19:44:47 +02:00
Michael Zanetti 8aa2feb7c6 Make python plugins appear in the logging categories list 2020-10-15 22:34:06 +02:00
Michael Zanetti e50eece45c Fix metatype registering for old Qt versions 2020-10-15 22:34:06 +02:00
Michael Zanetti fdbdb02c16 Make it compatible with python 3.5 2020-10-15 22:34:06 +02:00
Michael Zanetti 1018083052 add 2 missing data type conversions 2020-10-15 22:34:06 +02:00
Michael Zanetti 78e37f0d87 Fix shutdown 2020-10-15 22:34:06 +02:00
Michael Zanetti c7f957f201 some more python plugin work 2020-10-15 22:34:06 +02:00
Michael Zanetti 125aee7153 Some more python plugin stuff 2020-10-15 22:34:06 +02:00
Michael Zanetti 13d10b8aa0 some more python plugin work 2020-10-15 22:34:06 +02:00
Michael Zanetti 380e962bd1 some more work on python plugins 2020-10-15 22:34:06 +02:00
Michael Zanetti d17b44c83d Initial attempt to support python plugins 2020-10-15 22:34:06 +02:00
Michael Zanetti 8fee1bb2e5 Fix duplicate connections on case of retrying 2020-10-15 22:33:36 +02:00
Michael Zanetti 6aaab68cdc Retry setup if it fails at startup (e.g. network isn't up yet or similar) 2020-10-15 22:33:36 +02:00
Michael Zanetti 573a2c061a Don't call thingRemoved() on the plugin in case of reconfiguring
Reasoning:

a) Currently, the API behaves inconsistently. While reconfiguring
a "justAdd" thing, it did call thingRemoved, however, reconfiguring a thing
that uses pairing did not.

b) The old implementation did not consider childs. Reconfiguring a
justAdd thing which has childs was calling thingRemoved on the parent only
but not its childs.

c) If we'd fix this by calling thingRemoved() for all flows and childs
we'd end up in hells kitchen as we can't know about the new state of childs
after the reconfiguration, so we can't just automatically add all the childs
back ourselves, the plugin needs to do that. This in turn would mean that
childs would get new ids which then breaks rules and stuff.

So the conclusion has been to just re-run the setup and the plugin implementation
is in charge for then checking the existing childs and calling autoThingDisappeared()
as needed.

WARNING: This also implies that we need to fix some plugins which currently rely
on thingRemoved to be called for reconfiguration and might create duplicate
connections or similar now.
2020-09-01 13:45:14 +02:00
Jenkins nymea 70c9c7f495 Merge PR #323: Fix cleanig up tags that are not needed any more 2020-08-14 13:09:34 +02:00
Jenkins nymea 768b6a877e Merge PR #314: Fix conversion of values 2020-08-14 13:09:34 +02:00
Michael Zanetti 1066e768c9 Fix cleaning up of tags that are not needed any more 2020-08-13 17:40:08 +02:00
Michael Zanetti 399f406d10 fixes 2020-07-27 19:38:21 +02:00
Michael Zanetti 5002fad6d9 fix tests 2020-07-26 01:00:29 +02:00
Michael Zanetti 85146abca5 Fix type conversions of values
This fixes 5 issues in regard to types of values:

1) Default values for params in the metadata were not converted properly,
most visibly on integer values being loaded as double values.

2) Param values coming in from jsonrpc were not converted properly.

3) The plugin might set state values with invalid types or being out of range.

4) If, for some reason (e.g. earlier versions of nymea, or a plugin setting
its own params in code with a wrong type), there was a param value with a
wrong type in the system, we stored that wrong type and restored it on loading
of plugin params while instead it really should be converted to the specified
type in the ParamType.

5) If a plugin is not loaded for a configured thing, the old code would
not initialize the states properly but upon shutdown save those invalid
values to the cache.
2020-07-15 00:22:43 +02:00
Jenkins nymea c369bd15aa Merge PR #305: Allow emitting events from things directly 2020-07-14 11:26:14 +02:00
Jenkins nymea 7b60f05c64 Merge PR #299: Store state changes immediately when they change 2020-07-14 11:26:14 +02:00
Michael Zanetti f029184651 Allow emitting events from things directly 2020-06-16 16:16:23 +02:00
Jenkins nymea 7337105073 Merge PR #291: Fix thing class translations 2020-06-07 19:16:23 +02:00
Jenkins nymea 3156264787 Merge PR #283: Reject duplicate ids in plugin json 2020-06-07 19:16:23 +02:00
Jenkins nymea 60eebfc289 Merge PR #282: Add support for generic IO connections 2020-06-07 19:16:23 +02:00
Michael Zanetti 82703de061 Fixes after testing/review 2020-06-07 19:15:39 +02:00
Michael Zanetti cf2ce0ca27 Store state changes immediately when they change 2020-05-29 18:51:51 +02:00
Michael Zanetti 322bcf56a6 Add support for inverting the connections 2020-05-09 19:14:02 +02:00