2020 EventAffordance ,
2121 PropertyAffordance ,
2222)
23- from ..utils import set_global_event_loop_policy , uuid_hex
23+ from ..utils import uuid_hex
2424from .abstractions import ConsumedThingAction , ConsumedThingEvent , ConsumedThingProperty
2525from .http .consumed_interactions import HTTPAction , HTTPEvent , HTTPProperty
2626from .mqtt .consumed_interactions import MQTTConsumer # only one type for now
3535)
3636
3737
38- set_global_event_loop_policy ()
39-
40-
4138class ClientFactory :
4239 """
4340 An factory class for creating clients to interact with Things over different protocols.
@@ -68,7 +65,7 @@ def zmq(
6865 kwargs:
6966 Additional configuration options:
7067
71- - `logger`: `logging.Logger `, optional.
68+ - `logger`: `structlog.stdlib.BoundLogger `, optional.
7269 A custom logger instance to use for logging
7370 - `ignore_TD_errors`: `bool`, default `False`.
7471 Whether to ignore errors while fetching the Thing Description (TD)
@@ -204,10 +201,8 @@ def http(self, url: str, **kwargs) -> ObjectProxy:
204201 kwargs:
205202 Additional configuration options:
206203
207- - `logger`: `logging.Logger `, optional.
204+ - `logger`: `structlog.stdlib.BoundLogger `, optional.
208205 A custom logger instance to use for logging
209- - `log_level`: `int`, default `logging.INFO`.
210- The logging level to use for the client (e.g., logging.DEBUG, logging.INFO)
211206 - `ignore_TD_errors`: `bool`, default `False`.
212207 Whether to ignore errors while fetching the Thing Description (TD)
213208 - `skip_interaction_affordances`: `list[str]`, default `[]`.
@@ -220,6 +215,8 @@ def http(self, url: str, **kwargs) -> ObjectProxy:
220215 The timeout for establishing a HTTP connection (in seconds)
221216 - `request_timeout`: `float`, optional, default `60.0`.
222217 The timeout for completing a HTTP request (in seconds)
218+ - `security`: `BasicSecurity`, optional.
219+ The security scheme to use for authentication
223220 - `username`: `str`, optional.
224221 The username for HTTP Basic Authentication
225222 - `password`: `str`, optional.
@@ -378,10 +375,8 @@ def mqtt(
378375 kwargs:
379376 Additional configuration options:
380377
381- - `logger`: `logging.Logger `, optional.
378+ - `logger`: `structlog.stdlib.BoundLogger `, optional.
382379 A custom logger instance to use for logging
383- - `log_level`: `int`, default `logging.INFO`.
384- The logging level to use for the client (e.g., logging.DEBUG, logging.INFO
385380 """
386381 id = kwargs .get ("id" , f"mqtt-client|{ hostname } :{ port } |{ uuid_hex ()} " )
387382 logger = kwargs .get ("logger" , structlog .get_logger ()).bind (
0 commit comments