Model Classes¶
- pupil_labs.realtime_api.models.Component¶
Type annotation for
Status
components.Alias of
Union
[Phone
,Hardware
,Sensor
,Recording
,NetworkDevice
]
- pupil_labs.realtime_api.models.ComponentRaw¶
Type annotation for json-parsed responses from the REST and Websocket API.
- namedtuple pupil_labs.realtime_api.models.DiscoveredDeviceInfo(name, server, port, addresses)[source]¶
Bases:
NamedTuple
DiscoveredDeviceInfo(name, server, port, addresses)
- namedtuple pupil_labs.realtime_api.models.Event(name, recording_id, timestamp)[source]¶
Bases:
NamedTuple
Event(name, recording_id, timestamp)
- Fields:
- namedtuple pupil_labs.realtime_api.models.Hardware(version='unknown', glasses_serial='unknown', world_camera_serial='unknown', module_serial='unknown')[source]¶
Bases:
NamedTuple
Hardware(version, glasses_serial, world_camera_serial, module_serial)
- exception pupil_labs.realtime_api.models.InvalidTemplateAnswersError(template, answers, errors)[source]¶
Bases:
Exception
- namedtuple pupil_labs.realtime_api.models.NetworkDevice(ip, device_id, device_name, connected)[source]¶
Bases:
NamedTuple
Information about devices discovered by the host device, not the client.
Note
This class represents device information made available via the websocket update connection by the host device (exposed via
pupil_labs.realtime_api.device.Device.status_updates()
). Devices discovered directly by this library are represented asDiscoveredDeviceInfo
and returned bypupil_labs.realtime_api.discovery.discover_devices()
andpupil_labs.realtime_api.discovery.Network
.
- namedtuple pupil_labs.realtime_api.models.Phone(battery_level, battery_state, device_id, device_name, ip, memory, memory_state, time_echo_port=None)[source]¶
Bases:
NamedTuple
Phone(battery_level, battery_state, device_id, device_name, ip, memory, memory_state, time_echo_port)
- Fields:
battery_level (
int
) – Alias for field number 0battery_state (
Literal
['OK'
,'LOW'
,'CRITICAL'
]) – Alias for field number 1device_id (
str
) – Alias for field number 2device_name (
str
) – Alias for field number 3ip (
str
) – Alias for field number 4memory (
int
) – Alias for field number 5memory_state (
Literal
['OK'
,'LOW'
,'CRITICAL'
]) – Alias for field number 6
- namedtuple pupil_labs.realtime_api.models.Recording(action, id, message, rec_duration_ns)[source]¶
Bases:
NamedTuple
Recording(action, id, message, rec_duration_ns)
- Fields:
- namedtuple pupil_labs.realtime_api.models.Sensor(sensor, conn_type, connected=False, ip=None, params=None, port=None, protocol='rtsp')[source]¶
Bases:
NamedTuple
Sensor(sensor, conn_type, connected, ip, params, port, protocol)
- Fields:
- class pupil_labs.realtime_api.models.Status(phone, hardware, sensors, recording)[source]¶
Bases:
object
Represents the Companion’s full status
- class pupil_labs.realtime_api.models.Template(*args, **kwargs)[source]¶
Bases:
object
- items¶
Type:
List
[TemplateItem
]
- exception pupil_labs.realtime_api.models.UnknownComponentError[source]¶
Bases:
ValueError
- pupil_labs.realtime_api.models.parse_component(raw)[source]¶
Initialize an explicitly modelled representation (
pupil_labs.realtime_api.models.Component
) from the json-parsed dictionary (pupil_labs.realtime_api.models.ComponentRaw
) received from the API.- Raises:
UnknownComponentError – if the component name cannot be mapped to an explicitly modelled class or the contained data does not fit the modelled fields.
- Return type: