jvconnected.device

class jvconnected.device.Device(*args, **kwargs)[source]

Bases: Dispatcher

A Connected Cam device

Parameters
  • hostaddr (str) – The network host address

  • auth_user (str) – Api username

  • auth_pass (str) – Api password

  • id (str) – Unique string id

  • hostport (int, optional) – The network host port

Property model_name: str | None = None

Model name of the device

model_name is a pydispatch.Property object.

Property serial_number: str | None = None

The device serial number

serial_number is a pydispatch.Property object.

Property resolution: str | None = None

Current output resolution in string format

resolution is a pydispatch.Property object.

Property api_version: str | None = None

Api version supported by the device

api_version is a pydispatch.Property object.

Property device_index: int = 0

The device index

device_index is a pydispatch.Property object.

Property connected: bool = False

True communicating with the device

connected is a pydispatch.Property object.

Property connection_state: ConnectionState = ConnectionState.UNKNOWN

The device’s ConnectionState

connection_state is a pydispatch.Property object.

Property error: bool = False

Becomes True when a communication error occurs

error is a pydispatch.Property object.

DictProperty parameter_groups: tp.Dict[str, 'ParameterGroup']

Container for ParameterGroup instances

parameter_groups is a pydispatch.DictProperty object.

Event on_client_error(instance: Device, exc: Exception)[source]

Fired when an error is caught by the http client.

Parameters

on_client_error is a pydispatch.Event object.

property devicepreview: JpegSource

Instance of jvconnected.devicepreview.JpegSource to acquire real-time jpeg images

async open()[source]

Begin communication with the device

async close()[source]

Stop communication and close all connections

async queue_request(command: str, params=None)[source]

Enqueue a command to be sent in the _poll_loop()

class jvconnected.device.ParameterGroup(*args, **kwargs)[source]

Bases: Dispatcher

A logical group of device parameters

Parameters

device (Device) – The parent Device

_prop_attrs

A list of tuples to map instance attributes to the values returned by the api data from Device._request_cam_status()

Type

list

_optional_api_keys

A list of any api values that may not be available. If the parameter is missing during parse_status_response(), it will be allowed to fail if present in this list.

Type

list

Property name: str = ''

The group name

name is a pydispatch.Property object.

on_prop(instance, value, **kwargs)[source]

Debug method

drill_down_api_dict(api_key, data)[source]

Walk down nested dict values and return the final value

Parameters
  • api_key – Either a sequence or a string. If the string is separated by periods (.) it will be split by iter_api_key()

  • data (dict) – The response data from parse_status_response()

parse_status_response(data)[source]

Parse the response from Device._request_cam_status()

async close()[source]

Perform any cleanup actions before disconnecting

class jvconnected.device.MenuChoices(value)[source]

Bases: Enum

Values used in CameraParams.send_menu_button()

DISPLAY = 1

DISPLAY

STATUS = 2

STATUS

MENU = 3

MENU

CANCEL = 4

CANCEL

SET = 5

SET

UP = 6

UP

DOWN = 7

DOWN

LEFT = 8

LEFT

RIGHT = 9

RIGHT

class jvconnected.device.CameraParams(*args, **kwargs)[source]

Bases: ParameterGroup

Basic camera parameters

Property status: str | None = None

Camera status. One of ['NoCard', 'Stop', 'Standby', 'Rec', 'RecPause']

status is a pydispatch.Property object.

Property menu_status: bool = False

True if the camera menu is open

menu_status is a pydispatch.Property object.

Property mode: str | None = None

Camera record / media mode. One of ['Normal', 'Pre', 'Clip', 'Frame', 'Interval', 'Variable']

mode is a pydispatch.Property object.

Property timecode: str | None = None

The current timecode value

timecode is a pydispatch.Property object.

async send_menu_button(value: MenuChoices)[source]

Send a menu button event

Parameters

value (MenuChoices) – The menu button type as a member of MenuChoices

on_prop(instance, value, **kwargs)[source]

Debug method

class jvconnected.device.NTPParams(*args, **kwargs)[source]

Bases: ParameterGroup

NTP parameters

Property address: str = ''

The NTP server address (IP or URL)

address is a pydispatch.Property object.

Property tc_sync: bool = False

True if using NTP for timecode

tc_sync is a pydispatch.Property object.

Property syncronized: bool = False

Whether the device is syncronized to the server

syncronized is a pydispatch.Property object.

Property sync_master: bool = False

True if the device is being used as a TC and sync (Genlock) master 1

sync_master is a pydispatch.Property object.

async set_address(address: str)[source]

Set the NTP server address

class jvconnected.device.BatteryState(value)[source]

Bases: Enum

Values used for BatteryParams.state

UNKNOWN = 1

UNKNOWN

ERROR = 2

ERROR

NO_BATTERY = 3

NO_BATTERY

ON_BATTERY = 4

ON_BATTERY

CHARGING = 5

CHARGING

CHARGED = 6

CHARGED

class jvconnected.device.BatteryParams(*args, **kwargs)[source]

Bases: ParameterGroup

Battery Info

Property info_str: str | None = None

Type of value given to value_str. One of ['Time', 'Capacity', 'Voltage']

info_str is a pydispatch.Property object.

Property level_str: str | None = None

Numeric value indicating various charging/discharging states

level_str is a pydispatch.Property object.

Property value_str: str = '0'

One of remaining time (in minutes), capacity (percent) or voltage (x10) depending on the value of info_str

value_str is a pydispatch.Property object.

Property state: BatteryState = BatteryState.UNKNOWN

The current battery state

state is a pydispatch.Property object.

Property minutes: int = -1

Minutes remaining until full (while charging) or battery runtime (while on-battery). If unavailable, this will be -1

minutes is a pydispatch.Property object.

Property percent: int = -1

Capacity remaining. If unavailable, this will be -1

percent is a pydispatch.Property object.

Property voltage: float = -1

Battery voltage. If unavailable, this will be -1

voltage is a pydispatch.Property object.

on_prop(instance, value, **kwargs)[source]

Debug method

class jvconnected.device.MasterBlackDirection(value)[source]

Bases: Enum

Values used for ExposureParams.seesaw_master_black()

Up = 1

Up

Down = 2

Down

Stop = 3

Stop

class jvconnected.device.ExposureParams(*args, **kwargs)[source]

Bases: ParameterGroup

Exposure parameters

Property mode: str | None = None

Exposure mode. One of ['Auto', 'Manual', 'IrisPriority', 'ShutterPriority']

mode is a pydispatch.Property object.

Property iris_mode: str | None = None

Iris mode. One of ['Manual', 'Auto', 'AutoAELock']

iris_mode is a pydispatch.Property object.

Property iris_fstop: str | None = None

Character string for iris value

iris_fstop is a pydispatch.Property object.

Property iris_pos: int | None = None

Iris position (0-255)

iris_pos is a pydispatch.Property object.

Property gain_mode: str | None = None

Gain mode. One of ['ManualL', 'ManualM', 'ManualH', 'AGC', 'AlcAELock', 'LoLux', 'Variable']

gain_mode is a pydispatch.Property object.

Property gain_value: str | None = None

Gain value

gain_value is a pydispatch.Property object.

Property gain_pos: int = 0

The gain_value as an integer from -6 to 24

gain_pos is a pydispatch.Property object.

Property shutter_mode: str | None = None

Shutter mode. One of ['Off', 'Manual', 'Step', 'Variable', 'Eei']

shutter_mode is a pydispatch.Property object.

Property shutter_value: str | None = None

Shutter value

shutter_value is a pydispatch.Property object.

Property master_black: str | None = None

MasterBlack value

master_black is a pydispatch.Property object.

Property master_black_pos: int = 0

MasterBlack value as an integer from -50 to 50

master_black_pos is a pydispatch.Property object.

Property master_black_moving: bool = False

True if MasterBlack is being adjusted with the seesaw_master_black() method

master_black_moving is a pydispatch.Property object.

Property master_black_speed: int = 0

Current MasterBlack movement speed from -8 (down) to +8 (up) where 0 indicates no movement.

master_black_speed is a pydispatch.Property object.

async set_auto_iris(state: bool)[source]

Set iris mode

Parameters

state (bool) – If True, enable auto iris mode, otherwise set to manual

async set_auto_gain(state: bool)[source]

Set AGC mode

Parameters

state (bool) – If True, enable auto gain mode, otherwise set to manual

async set_iris_pos(value: int)[source]

Set the iris position value

Parameters

value (int) – The iris value from 0 (closed) to 255 (open)

async increase_iris()[source]

Increase (open) iris

async decrease_iris()[source]

Decrease (close) iris

async adjust_iris(direction: bool)[source]

Increment (open) or decrement (close) iris

Parameters

direction (bool) – If True, increment, otherwise decrement

async increase_gain()[source]

Increase gain

async decrease_gain()[source]

Decrease gain

async adjust_gain(direction: bool)[source]

Increment or decrement gain

Parameters

direction (bool) – If True, increment, otherwise decrement

async increase_master_black()[source]

Increase master black

async decrease_master_black()[source]

Decrease master black

async adjust_master_black(direction: bool)[source]

Increment or decrement master black

Parameters

direction (bool) – If True, increment, otherwise decrement

async seesaw_master_black(direction: MasterBlackDirection | str | int, speed: int)[source]

Start or stop MasterBlack movement

Parameters
on_prop(instance, value, **kwargs)[source]

Debug method

class jvconnected.device.FocusMode(value)[source]

Bases: Enum

Values used for LensParams.focus_mode

AF = 3

Auto focus

MF = 5

Manual focus

class jvconnected.device.ZoomDirection(value)[source]

Bases: Enum

Values used for LensParams.seesaw_zoom()

Wide = 1

Wide

Tele = 2

Telephoto

Stop = 3

Stop

class jvconnected.device.FocusDirection(value)[source]

Bases: Enum

Values used for LensParams.seesaw_focus()

Near = 1

Near

Far = 2

Far

Stop = 3

Stop

class jvconnected.device.LensParams(*args, **kwargs)[source]

Bases: ParameterGroup

Lens Parameters

Property focus_mode: FocusMode = FocusMode.Unknown

The current focus mode

focus_mode is a pydispatch.Property object.

Property focus_value: str | None = None

Character string for focus value

focus_value is a pydispatch.Property object.

Property zoom_pos: int = 0

Zoom position from 0 to 499

zoom_pos is a pydispatch.Property object.

Property zoom_value: str | None = None

Character string for zoom value

zoom_value is a pydispatch.Property object.

Property focus_speed: int = 0

Current focus speed from -8 (near) to +8 (far) where 0 indicates no movement

focus_speed is a pydispatch.Property object.

Property zoom_speed: int = 0

Current zoom speed from -8 (wide) to +8 (tele) where 0 indicates no movement

zoom_speed is a pydispatch.Property object.

Property focusing: bool = False

True while focus is moving

focusing is a pydispatch.Property object.

Property zooming: bool = False

True while zoom is moving

zooming is a pydispatch.Property object.

async set_focus_mode(mode)[source]

Set focus mode

Parameters

mode – A FocusMode enum member, its string name or integer value

async set_zoom_position(value)[source]

Set the zoom position

Parameters

value (int) – The zoom position from 0 to 499

async focus_near(speed)[source]

Begin focusing “near”

Parameters

speed (int) – Focus speed from 0 to 8 (0 stops movement)

async focus_far(speed)[source]

Begin focusing “far”

Parameters

speed (int) – Focus speed from 0 to 8 (0 stops movement)

async focus_stop()[source]

Stop focus movement

async focus_push_auto()[source]

Focus PushAuto

async zoom_wide(speed)[source]

Begin zooming “wide” (or “out”)

Parameters

speed (int) – Zoom speed from 0 to 8 (0 stops movement)

async zoom_tele(speed)[source]

Begin zooming “tele” (or “in”)

Parameters

speed (int) – Zoom speed from 0 to 8 (0 stops movement)

async zoom_stop()[source]

Stop zoom movement

async seesaw_focus(direction, speed)[source]

Start or stop focus movement

Parameters
  • direction – Either a FocusDirection member, the name as str, or the integer value of one of the members

  • speed (int) – The focus speed from 0 to 8 (0 stops movement)

async seesaw_zoom(direction, speed)[source]

Start or stop zoom movement

Parameters
  • direction – Either a ZoomDirection member, the name as str, or the integer value of one of the members

  • speed (int) – The zoom speed from 0 to 8 (0 stops movement)

on_prop(instance, value, **kwargs)[source]

Debug method

class jvconnected.device.ZoomPreset(*args, **kwargs)[source]

Bases: Dispatcher

Preset data for PresetZoomParams

Property is_active: bool = False

Flag indicating if the current zoom_pos matches the preset value

is_active is a pydispatch.Property object.

Property name: str = ''

The preset name (one of ["A", "B", "C"])

name is a pydispatch.Property object.

Property value: int = -1

The zoom_pos stored in the preset. (-1 indicates no data is stored)

value is a pydispatch.Property object.

class jvconnected.device.PresetZoomParams(*args, **kwargs)[source]

Bases: ParameterGroup

Preset zoom

DictProperty presets: Dict[str, ZoomPreset]

Mapping of ZoomPreset objects stored by their name

presets is a pydispatch.DictProperty object.

async set_preset(name: str, value: int | None = None)[source]

Set zoom position for the given preset

Parameters
  • name (str) – The name of preset to store

  • value (int | None) – The zoom position in the range of 0 - 499. If not given, the current zoom_pos is used.

async recall_preset(name: str)[source]

Recall the preset by the given name

async clear_preset(name: str)[source]

Delete the value for the given preset

class jvconnected.device.PaintParams(*args, **kwargs)[source]

Bases: ParameterGroup

Paint parameters

Property white_balance_mode: str = None

Current white balance mode. One of ['Preset', 'A', 'B', 'Faw', 'FawAELock', 'Faw', 'Awb', 'OnePush', '3200K', '5600K', 'Manual']

white_balance_mode is a pydispatch.Property object.

Property color_temp: str | None = None

White balance value

color_temp is a pydispatch.Property object.

Property red_scale: int = 64

Total range for WB red paint (0-64)

red_scale is a pydispatch.Property object.

Property red_pos: int | None = None

Current position of red_value (WB red paint) in the range of 0-64

red_pos is a pydispatch.Property object.

Property red_value: str | None = None

Character string for WB red paint value

red_value is a pydispatch.Property object.

Property red_normalized: int = 0

red_pos from -31 to +31

red_normalized is a pydispatch.Property object.

Property blue_scale: int = 64

Total range for WB blue paint (0-64)

blue_scale is a pydispatch.Property object.

Property blue_pos: int | None = None

Current position of blue_value (WB blue paint) in the range of 0-64

blue_pos is a pydispatch.Property object.

Property blue_value: str | None = None

Character string for WB blue paint value

blue_value is a pydispatch.Property object.

Property blue_normalized: int = 0

blue_pos from -31 to +31

blue_normalized is a pydispatch.Property object.

Property detail: str | None = None

Detail value as string

detail is a pydispatch.Property object.

Property detail_pos: int = 0

detail as an integer from -10 to +10

detail_pos is a pydispatch.Property object.

async set_white_balance_mode(mode: str)[source]

Set white balance mode

Parameters

mode (str) – The mode to set. Possible values are ['Faw', 'Preset', 'A', 'B', 'Adjust', 'WhPaintRP', 'WhPaintRM', 'WhPaintBP', 'WhPaintBM', 'Awb', '3200K', '5600K', 'Manual']

async set_red_pos(red: int)[source]

Set red value

Parameters

red (int) – Red value in range -31 to +31

async set_blue_pos(blue: int)[source]

Set blue value

Parameters

blue (int) – Blue value in range -31 to +31

async set_wb_pos(red: int, blue: int)[source]

Set red/blue values

Parameters
  • red (int) – Red value in range -31 to +31

  • blue (int) – Blue value in range -31 to +31

async set_wb_pos_raw(red: int, blue: int)[source]

Set raw values for red/blue

Parameters
  • red (int) – Red value in range 0 to 64

  • blue (int) – Blue value in range 0 to 64

async increase_detail()[source]

Increment detail value

async decrease_detail()[source]

Decrease detail value

async adjust_detail(direction: bool)[source]

Increment or decrement detail

Parameters

direction (bool) – If True, increment, otherwise decrement

on_prop(instance, value, **kwargs)[source]

Debug method

class jvconnected.device.TallyParams(*args, **kwargs)[source]

Bases: ParameterGroup

Tally light parameters

Property program: bool = False

True if program tally is lit

program is a pydispatch.Property object.

Property preview: bool = False

True if preview tally is lit

preview is a pydispatch.Property object.

Property tally_priority: str | None = None

The tally priority. One of ['Camera', 'Web'].

tally_priority is a pydispatch.Property object.

Property tally_status: str | None = None

Tally light status. One of ['Off', 'Program', 'Preview']

tally_status is a pydispatch.Property object.

async set_program(state: bool = True)[source]

Enable or Disable Program tally

Parameters

state (bool, optional) – If False, turns off the tally light

async set_preview(state: bool = True)[source]

Enable or Disable Preview tally

Parameters

state (bool, optional) – If False, turns off the tally light

async set_tally_light(value: str)[source]

Set tally light state

Parameters

value (str) – One of ‘Program’, ‘Preview’ or ‘Off’

async close()[source]

Perform any cleanup actions before disconnecting

on_prop(instance, value, **kwargs)[source]

Debug method

jvconnected.device.main(hostaddr, auth_user, auth_pass, id_=None)[source]

Build a device and open it

Footnotes

1

The documentation for this isn’t entirely clear, so the behavior is only assumed (as the author only has one type of camera to test with).