bimmer_connected.utils
¶
General utils and base classes used in the library.
-
class
bimmer_connected.utils.
MyBMWJSONEncoder
(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)[source]¶ JSON Encoder that handles data classes, properties and additional data types.
-
default
(o) → Union[str, dict][source]¶ Implement this method in a subclass such that it returns a serializable object for
o
, or calls the base implementation (to raise aTypeError
).For example, to support arbitrary iterators, you could implement default like this:
def default(self, o): try: iterable = iter(o) except TypeError: pass else: return list(iterable) # Let the base class default method raise the TypeError return JSONEncoder.default(self, o)
-
-
bimmer_connected.utils.
get_class_property_names
(obj: object)[source]¶ Return the names of all properties of a class.
-
bimmer_connected.utils.
log_response_store_to_file
(response_store: List[bimmer_connected.models.AnonymizedResponse], logfile_path: pathlib.Path) → None[source]¶ Log all responses to files.