pyrokid_cxr_clientm.customview

Rokid’s CXR CustomView requires you to make JSON

This namespace will help you making sure you got valid CustomView JSON

This is unofficial code, Rokid doesn’t supply any of this!

class pyrokid_cxr_clientm.customview.ImageViewProps(id: str, layout_width: str = 'match_parent', layout_height: str = 'wrap_content', layout_toStartOf: str | None = None, layout_above: str | None = None, layout_toEndOf: str | None = None, layout_below: str | None = None, layout_alignBaseLine: str | None = None, layout_alignStart: str | None = None, layout_alignEnd: str | None = None, layout_alignTop: str | None = None, layout_alignBottom: str | None = None, layout_alignParentStart: str | None = None, layout_alignParentEnd: str | None = None, layout_alignParentTop: str | None = None, layout_alignParentBottom: str | None = None, layout_centerInParent: str | None = None, layout_centerHorizontal: str | None = None, layout_centerVertical: str | None = None, name: str = 'NONE', scaleType: str | None = None)[source]

Bases: Props

ImageViewProps class

classmethod from_dict(kvs: dict | list | str | int | float | bool | None, *, infer_missing=False) A
classmethod from_json(s: str | bytes | bytearray, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) A
name: str = 'NONE'

Name of a uploaded Icon. Upload icons using the :func:CxrApi.sendCustomViewIcons:

scaleType: str | None = None

Supported values: matrix, fix_xy, fix_start, fix_center, fix_end, center, center_crop, center_inside

classmethod schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) SchemaF[A]
to_dict(encode_json=False) Dict[str, dict | list | str | int | float | bool | None]
to_json(*, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: str | int | None = None, separators: Tuple[str, str] | None = None, default: Callable | None = None, sort_keys: bool = False, **kw) str
class pyrokid_cxr_clientm.customview.LinearLayoutProps(id: str | None = None, layout_width: str = 'match_parent', layout_height: str = 'wrap_content', layout_toStartOf: str | None = None, layout_above: str | None = None, layout_toEndOf: str | None = None, layout_below: str | None = None, layout_alignBaseLine: str | None = None, layout_alignStart: str | None = None, layout_alignEnd: str | None = None, layout_alignTop: str | None = None, layout_alignBottom: str | None = None, layout_alignParentStart: str | None = None, layout_alignParentEnd: str | None = None, layout_alignParentTop: str | None = None, layout_alignParentBottom: str | None = None, layout_centerInParent: str | None = None, layout_centerHorizontal: str | None = None, layout_centerVertical: str | None = None, padding: str | None = None, paddingStart: str | None = None, paddingEnd: str | None = None, paddingTop: str | None = None, paddingBottom: str | None = None, margin: str | None = None, marginStart: str | None = None, marginEnd: str | None = None, marginTop: str | None = None, marginBottom: str | None = None, gravity: str | None = None, orientation: str | None = None, layout_weight: str | None = None, backgroundColor: str | None = None)[source]

Bases: PropsWithPaddingAndMargin

LinearLayoutProps class

backgroundColor: str | None = None
classmethod from_dict(kvs: dict | list | str | int | float | bool | None, *, infer_missing=False) A
classmethod from_json(s: str | bytes | bytearray, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) A
gravity: str | None = None

Supported values: center, center_vertical, center_horizontal, start, end, top, bottom

id: str | None = None
layout_weight: str | None = None
orientation: str | None = None

Supported values: vertical, horizontal

classmethod schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) SchemaF[A]
to_dict(encode_json=False) Dict[str, dict | list | str | int | float | bool | None]
to_json(*, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: str | int | None = None, separators: Tuple[str, str] | None = None, default: Callable | None = None, sort_keys: bool = False, **kw) str
class pyrokid_cxr_clientm.customview.Props(id: str, layout_width: str = 'match_parent', layout_height: str = 'wrap_content', layout_toStartOf: str | None = None, layout_above: str | None = None, layout_toEndOf: str | None = None, layout_below: str | None = None, layout_alignBaseLine: str | None = None, layout_alignStart: str | None = None, layout_alignEnd: str | None = None, layout_alignTop: str | None = None, layout_alignBottom: str | None = None, layout_alignParentStart: str | None = None, layout_alignParentEnd: str | None = None, layout_alignParentTop: str | None = None, layout_alignParentBottom: str | None = None, layout_centerInParent: str | None = None, layout_centerHorizontal: str | None = None, layout_centerVertical: str | None = None)[source]

Bases: object

Props class

classmethod from_dict(kvs: dict | list | str | int | float | bool | None, *, infer_missing=False) A
classmethod from_json(s: str | bytes | bytearray, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) A
id: str
layout_above: str | None = None

Value is supposed to be the id of another child. Only usable when SelfView is a child of a RelativeLayout

layout_alignBaseLine: str | None = None

Value is supposed to be the id of another child. Only usable when SelfView is a child of a RelativeLayout

layout_alignBottom: str | None = None

Value is supposed to be the id of another child. Only usable when SelfView is a child of a RelativeLayout

layout_alignEnd: str | None = None

Value is supposed to be the id of another child. Only usable when SelfView is a child of a RelativeLayout

layout_alignParentBottom: str | None = None

Supported values: true, false. Only usable when SelfView is a child of a RelativeLayout

layout_alignParentEnd: str | None = None

Supported values: true, false. Only usable when SelfView is a child of a RelativeLayout

layout_alignParentStart: str | None = None

Supported values: true, false. Only usable when SelfView is a child of a RelativeLayout

layout_alignParentTop: str | None = None

Supported values: true, false. Only usable when SelfView is a child of a RelativeLayout

layout_alignStart: str | None = None

Value is supposed to be the id of another child. Only usable when SelfView is a child of a RelativeLayout

layout_alignTop: str | None = None

Value is supposed to be the id of another child. Only usable when SelfView is a child of a RelativeLayout

layout_below: str | None = None

Value is supposed to be the id of another child. Only usable when SelfView is a child of a RelativeLayout

layout_centerHorizontal: str | None = None

Supported values: true, false. Only usable when SelfView is a child of a RelativeLayout

layout_centerInParent: str | None = None

Supported values: true, false. Only usable when SelfView is a child of a RelativeLayout

layout_centerVertical: str | None = None

Supported values: true, false. Only usable when SelfView is a child of a RelativeLayout

layout_height: str = 'wrap_content'

Support values: match_parent, wrap_content or a dp number

layout_toEndOf: str | None = None

Value is supposed to be the id of another child. Only usable when SelfView is a child of a RelativeLayout

layout_toStartOf: str | None = None

Value is supposed to be the id of another child. Only usable when SelfView is a child of a RelativeLayout

layout_width: str = 'match_parent'

Support values: match_parent, wrap_content or a dp number

classmethod schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) SchemaF[A]
to_dict(encode_json=False) Dict[str, dict | list | str | int | float | bool | None]
to_json(*, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: str | int | None = None, separators: Tuple[str, str] | None = None, default: Callable | None = None, sort_keys: bool = False, **kw) str
class pyrokid_cxr_clientm.customview.PropsWithPaddingAndMargin(id: str, layout_width: str = 'match_parent', layout_height: str = 'wrap_content', layout_toStartOf: str | None = None, layout_above: str | None = None, layout_toEndOf: str | None = None, layout_below: str | None = None, layout_alignBaseLine: str | None = None, layout_alignStart: str | None = None, layout_alignEnd: str | None = None, layout_alignTop: str | None = None, layout_alignBottom: str | None = None, layout_alignParentStart: str | None = None, layout_alignParentEnd: str | None = None, layout_alignParentTop: str | None = None, layout_alignParentBottom: str | None = None, layout_centerInParent: str | None = None, layout_centerHorizontal: str | None = None, layout_centerVertical: str | None = None, padding: str | None = None, paddingStart: str | None = None, paddingEnd: str | None = None, paddingTop: str | None = None, paddingBottom: str | None = None, margin: str | None = None, marginStart: str | None = None, marginEnd: str | None = None, marginTop: str | None = None, marginBottom: str | None = None)[source]

Bases: Props

PropsWithPaddingAndMargin class

classmethod from_dict(kvs: dict | list | str | int | float | bool | None, *, infer_missing=False) A
classmethod from_json(s: str | bytes | bytearray, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) A
margin: str | None = None
marginBottom: str | None = None
marginEnd: str | None = None
marginStart: str | None = None
marginTop: str | None = None
padding: str | None = None
paddingBottom: str | None = None
paddingEnd: str | None = None
paddingStart: str | None = None
paddingTop: str | None = None
classmethod schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) SchemaF[A]
to_dict(encode_json=False) Dict[str, dict | list | str | int | float | bool | None]
to_json(*, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: str | int | None = None, separators: Tuple[str, str] | None = None, default: Callable | None = None, sort_keys: bool = False, **kw) str
class pyrokid_cxr_clientm.customview.RelativeLayoutProps(id: str | None = None, layout_width: str = 'match_parent', layout_height: str = 'wrap_content', layout_toStartOf: str | None = None, layout_above: str | None = None, layout_toEndOf: str | None = None, layout_below: str | None = None, layout_alignBaseLine: str | None = None, layout_alignStart: str | None = None, layout_alignEnd: str | None = None, layout_alignTop: str | None = None, layout_alignBottom: str | None = None, layout_alignParentStart: str | None = None, layout_alignParentEnd: str | None = None, layout_alignParentTop: str | None = None, layout_alignParentBottom: str | None = None, layout_centerInParent: str | None = None, layout_centerHorizontal: str | None = None, layout_centerVertical: str | None = None, padding: str | None = None, paddingStart: str | None = None, paddingEnd: str | None = None, paddingTop: str | None = None, paddingBottom: str | None = None, margin: str | None = None, marginStart: str | None = None, marginEnd: str | None = None, marginTop: str | None = None, marginBottom: str | None = None, backgroundColor: str | None = None)[source]

Bases: PropsWithPaddingAndMargin

RelativeLayoutProps class

backgroundColor: str | None = None
classmethod from_dict(kvs: dict | list | str | int | float | bool | None, *, infer_missing=False) A
classmethod from_json(s: str | bytes | bytearray, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) A
id: str | None = None
classmethod schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) SchemaF[A]
to_dict(encode_json=False) Dict[str, dict | list | str | int | float | bool | None]
to_json(*, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: str | int | None = None, separators: Tuple[str, str] | None = None, default: Callable | None = None, sort_keys: bool = False, **kw) str
class pyrokid_cxr_clientm.customview.SelfView(type: str, props: Props, children: list[SelfView] | None = None)[source]

Bases: object

SelfView class

children: list[SelfView] | None = None
classmethod from_dict(kvs: dict | list | str | int | float | bool | None, *, infer_missing=False) A
classmethod from_json(s: str | bytes | bytearray, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) A
props: Props
classmethod schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) SchemaF[A]
to_dict(encode_json=False) Dict[str, dict | list | str | int | float | bool | None]
to_json(*, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: str | int | None = None, separators: Tuple[str, str] | None = None, default: Callable | None = None, sort_keys: bool = False, **kw) str
type: str
class pyrokid_cxr_clientm.customview.TextViewProps(id: str, layout_width: str = 'match_parent', layout_height: str = 'wrap_content', layout_toStartOf: str | None = None, layout_above: str | None = None, layout_toEndOf: str | None = None, layout_below: str | None = None, layout_alignBaseLine: str | None = None, layout_alignStart: str | None = None, layout_alignEnd: str | None = None, layout_alignTop: str | None = None, layout_alignBottom: str | None = None, layout_alignParentStart: str | None = None, layout_alignParentEnd: str | None = None, layout_alignParentTop: str | None = None, layout_alignParentBottom: str | None = None, layout_centerInParent: str | None = None, layout_centerHorizontal: str | None = None, layout_centerVertical: str | None = None, padding: str | None = None, paddingStart: str | None = None, paddingEnd: str | None = None, paddingTop: str | None = None, paddingBottom: str | None = None, margin: str | None = None, marginStart: str | None = None, marginEnd: str | None = None, marginTop: str | None = None, marginBottom: str | None = None, text: str = 'NONE', textColor: str | None = None, textSize: str | None = None, gravity: str | None = None, textStyle: str | None = None)[source]

Bases: PropsWithPaddingAndMargin

TextViewProps class

classmethod from_dict(kvs: dict | list | str | int | float | bool | None, *, infer_missing=False) A
classmethod from_json(s: str | bytes | bytearray, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) A
gravity: str | None = None

Supported values: center, center_vertical, center_horizontal, start, end, top, bottom

classmethod schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) SchemaF[A]
text: str = 'NONE'
textColor: str | None = None
textSize: str | None = None
textStyle: str | None = None

Supported values: bold, italic, bold_italic

to_dict(encode_json=False) Dict[str, dict | list | str | int | float | bool | None]
to_json(*, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: str | int | None = None, separators: Tuple[str, str] | None = None, default: Callable | None = None, sort_keys: bool = False, **kw) str
class pyrokid_cxr_clientm.customview.UpdateView(id: str, action: str = 'update', props: Dict[str, str]=<factory>)[source]

Bases: object

UpdateView class

action: str = 'update'
classmethod from_dict(kvs: dict | list | str | int | float | bool | None, *, infer_missing=False) A
classmethod from_json(s: str | bytes | bytearray, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) A
id: str
props: Dict[str, str]
classmethod schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) SchemaF[A]
to_dict(encode_json=False) Dict[str, dict | list | str | int | float | bool | None]
to_json(*, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: str | int | None = None, separators: Tuple[str, str] | None = None, default: Callable | None = None, sort_keys: bool = False, **kw) str