preheat_open.api.types.ComponentQuery

class preheat_open.api.types.ComponentQuery(exclude=<factory>, cid=<factory>, id=<factory>, name=<factory>, unit=<factory>, type=<factory>, parent=<factory>)

Bases: Query

__init__(exclude=<factory>, cid=<factory>, id=<factory>, name=<factory>, unit=<factory>, type=<factory>, parent=<factory>)

Methods

__init__([exclude, cid, id, name, unit, ...])

convert_attr(value, name)

Converts an attribute to the appropriate type based on the class definition.

from_kwargs([query])

Creates a Query object from keyword arguments.

is_type(obj)

Checks if the object is of the type specified by the query class.

isin(iterable)

Checks if the query matches any element in the iterable.

Attributes

exclude

cid

id

name

unit

type

parent

classmethod convert_attr(value, name)

Converts an attribute to the appropriate type based on the class definition.

Parameters:
  • value (Any) – The value to convert.

  • name (str) – The name of the attribute.

Returns:

The converted value.

Return type:

Any

classmethod from_kwargs(query=None, **kwargs)

Creates a Query object from keyword arguments.

Parameters:
  • query (Query, optional) – An existing Query object to use as a base.

  • kwargs – Additional keyword arguments to set as query attributes.

Returns:

A new Query object.

Return type:

Query

Raises:

TypeError – If unknown keys are provided in kwargs.

classmethod is_type(obj)

Checks if the object is of the type specified by the query class.

Parameters:

obj (object) – The object to check.

Returns:

True if the object is of the specified type, False otherwise.

Return type:

bool

isin(iterable)

Checks if the query matches any element in the iterable.

Parameters:

iterable (Iterable) – The iterable to check against the query.

Returns:

True if the query matches any element in the iterable, False otherwise.

Return type:

bool