889 Commits

Author SHA1 Message Date
Mose Müller
245b1844c9 adds update_value method to reduce code duplication 2024-04-16 10:08:42 +02:00
Mose Müller
d48ae9f5ad adds trigger_method function to reduce code duplication 2024-04-16 09:59:39 +02:00
Mose Müller
cf637d19ae adds docstring to ProxyClass 2024-04-16 09:49:00 +02:00
Mose Müller
edfb7d0341 Using super() in proxy class constructor 2024-04-16 09:36:34 +02:00
Mose Müller
7b06786307 updates pydase.Client documentation and constructor arguments 2024-04-16 09:34:29 +02:00
Mose Müller
5eeaefdd63 refactors client sio event setup 2024-04-15 08:16:46 +02:00
Mose Müller
f65a0e31c3 udpates client tests 2024-04-09 13:52:41 +02:00
Mose Müller
fbada6d818 adds ProxyList methods 2024-04-09 13:43:43 +02:00
Mose Müller
507f286963 adds blocking kwarg to client
If blocking is true, client init will wait until it could connect to the server.
2024-04-09 13:27:55 +02:00
Mose Müller
c148eba5dd updates client tests 2024-04-09 09:25:47 +02:00
Mose Müller
61c7dc8333 client retries to connect if server is not available. Connection process is not blocking anymore 2024-04-09 09:25:01 +02:00
Mose Müller
a879b09e0b updates version to 0.8.0 2024-04-09 09:25:01 +02:00
Mose Müller
bba21e3241 adds Client tests 2024-04-09 09:25:01 +02:00
Mose Müller
16bd17f75c adds deserializer tests 2024-04-09 09:25:01 +02:00
Mose Müller
ad2800aaf6 improves exception deserialization
Tries to use builtins exceptions if possible.
2024-04-08 11:13:14 +02:00
Mose Müller
d792601663 removes out-dated tests 2024-04-08 10:23:24 +02:00
Mose Müller
166fc57877 adds property observer test 2024-04-08 10:23:24 +02:00
Mose Müller
5b762db535 fixes detection of property dependencies for classes inheriting from other observables
Inheriting from a class that itself has defined properties, you cannot get those properties by calling
vars(type(obj)). Instead, you have to go through all the classes' members and check if they are properties.
You can either do this using dir(type(obj)) and get the members using getattr or just use inspect.getmembers.
2024-04-08 10:23:24 +02:00
Mose Müller
73b2355d35 fixes Client specific errors when setting proxy attributes / methods
Also ignores mypy errors
2024-04-08 10:23:24 +02:00
Mose Müller
6335ea21ad fixes warnings in ProxyClassMixin 2024-04-04 16:30:26 +02:00
Mose Müller
690ecd7317 adds aiohttp to python deps (used for socketio.AsyncClient) 2024-04-04 16:26:28 +02:00
Mose Müller
9cb667581a removes exposed dump method (circular import apparently)
fixes test
2024-04-04 16:26:28 +02:00
Mose Müller
5936e7091e updates sio events
- adds disconnect event which marks the DeviceConnection as disconnected
- updates connect event to notify the observer about the new state and set connected to True
2024-04-04 16:20:31 +02:00
Mose Müller
ad0fd8e833 updates proxy class usage
- ProxyClass class is inheriting from DeviceConnection and is only used for topmost proxy
- classes of nested proxy objects are dynamically created to keep their component types
- adds _initialise method to ProxyClassMixin as I cannot pass sio_client and loop to each
component_class (initialising a class with multiple base classes will pass the arguments passed to
the constructor to each initialiser function)
2024-04-04 16:19:29 +02:00
Mose Müller
473c6660e6 fixes warnings 2024-04-04 11:41:12 +02:00
Mose Müller
5511ebc808 updates client proxy
- will now be changed in place (instead of being overwritten on reconnect, which was the only way
of adding or removing property getters / setters)
- replaces getters/setters and methods of proxy with __setattr__ and __getattribute__ functionality
- replaces ProxyClassFactory with ProxyClass and ProxyLoader. The latter updates the former on
reconnect
- client does not need to be a DataService anymore. It only establishes the connection and holds
the reference to the proxy class.
2024-04-04 11:31:14 +02:00
Mose Müller
439665177d removes unused attribute of ProxyConnection 2024-04-03 10:54:03 +02:00
Mose Müller
c0b25c0581 adds Client to default exports of pydase 2024-04-03 10:47:46 +02:00
Mose Müller
60a7dda60a restructures client to have separate thread for its asyncio loop 2024-04-03 10:28:06 +02:00
Mose Müller
381d98b078 updates is_property_attribute to accept the full_access_path instead of the attr_name only 2024-03-29 08:47:24 +01:00
Mose Müller
658fb13d9d improves Client._notify_changed by not emitting sio events when properties change 2024-03-29 08:44:48 +01:00
Mose Müller
a582dc23ac makes proxyclass reconnection wait time a float to not get warning 2024-03-29 08:44:20 +01:00
Mose Müller
19b24f3060 avoids notifying server when updates are pushed from the server itself 2024-03-28 18:41:01 +01:00
Mose Müller
d100bb5fea udpates Client and ProxyClassFactory
- Client:
  - inherits from DataService now
  - acts as an observer of the proxy class and sends updates to the sio server
- ProxyClassFactory
  - ProxyConnection is now a DeviceConnection -> users will see if the client is connected
2024-03-28 18:41:01 +01:00
Mose Müller
36a70badce fixes observable _construct_extended_attr_path
Passing an empty string resulted in an extended path ending with a "."
2024-03-28 18:13:44 +01:00
Mose Müller
9916d6df60 adds support for dynamically adding attributes to DataService instances 2024-03-28 14:30:09 +01:00
Mose Müller
b4c84da57e npm run build 2024-03-28 11:31:12 +01:00
Mose Müller
ecf0e99318 fixes units test 2024-03-28 11:30:18 +01:00
Mose Müller
10ac007a0c ignores complexity errors 2024-03-28 11:30:07 +01:00
Mose Müller
900017791a fixes loading of removed attributes. Prints debug log instead of raising exception 2024-03-28 11:27:16 +01:00
Mose Müller
edb06b1612 restructures StateManager
- Updates logic of loading the state
- set_service_attribut_value_by_path expects serialized object instead of the value now
- uses loads instead of __convert_value_if_needed now
2024-03-28 10:21:28 +01:00
Mose Müller
bb5205b2e4 get_object_attr_from_path expects string instead of list now 2024-03-28 10:18:43 +01:00
Mose Müller
c02c75aab5 prevents users to override nested ProxyClasses in sio client proxy 2024-03-28 10:09:08 +01:00
Mose Müller
cc3fdfbb27 makes sio client private on ProxyClass 2024-03-28 09:48:25 +01:00
Mose Müller
7d399df158 proxy class will raise exception raised on server when setting value 2024-03-28 09:29:37 +01:00
Mose Müller
92e2c0e8ef fixes deserialization of floats 2024-03-28 08:57:59 +01:00
Mose Müller
65f63e08ae fixes changing Quantity from frontend 2024-03-28 08:55:58 +01:00
Mose Müller
4eddf4b980 todos 2024-03-27 17:50:51 +01:00
Mose Müller
9d7099f116 updates socket.ts (passing access_path to backend) 2024-03-27 17:49:57 +01:00
Mose Müller
3f096bda96 fixes loading enum from json file
Loading from json file happens by name. The sio client will send the whole
enumeration and thus we have to handle both strings and enumerations.
2024-03-27 17:30:37 +01:00