jvconnected.device

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

Bases: pydispatch.dispatch.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

Properties
model_name: str Property(str)
serial_number: str Property(str)
resolution: str Property(str)
api_version: str Property(str)
parameter_groups: dict DictProperty(dict)

Container for ParameterGroup instances

connected: bool Property(bool)

Connection state

device_index: int Property(int)

The device index

error: bool Property(bool)

Becomes True when a communication error occurs

Events
on_client_error(self, exc)

Fired when an error is caught by the http client. The first argument is the Device instance and the second argument is the Exception that was raised

property devicepreview JpegSource   [read-only]

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: pydispatch.dispatch.Dispatcher

A logical group of device parameters

Parameters

device (Device) – The parent Device

Properties
name: str Property(str)

The group name

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

  • _optional_api_keys (list) – 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.

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.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: jvconnected.device.ParameterGroup

Basic camera parameters

Properties
status: str Property(str)

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

mode: str Property(str)

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

timecode: str Property(str)

The current timecode value

menu_status: bool Property(bool)

True if the camera menu is open

async send_menu_button(value: jvconnected.device.MenuChoices)[source]

Send a menu button event

Parameters

value – The menu button type as a member of MenuChoices

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

Debug method

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

Bases: enum.Enum

Values used for BatteryParams.state

UNKNOWN = 1

UNKNOWN

NO_BATTERY = 2

NO_BATTERY

ON_BATTERY = 3

ON_BATTERY

CHARGING = 4

CHARGING

CHARGED = 5

CHARGED

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

Bases: jvconnected.device.ParameterGroup

Battery Info

Properties
info_str: str Property(str)

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

level_str: str Property(str)

Numeric value indicating various charging/discharging states

value_str: str Property(str)

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

state: BatteryState Property(BatteryState)

The current battery state as a member of BatteryState

minutes: int Property(int)

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

percent: int Property(int)

Capacity remaining. If unavailable, this will be -1

voltage: float Property(float)

Battery voltage. If unavailable, this will be -1

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

Debug method

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

Bases: jvconnected.device.ParameterGroup

Exposure parameters

Properties
mode: str Property(str)

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

iris_mode: str Property(str)

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

iris_fstop: str Property(str)

Character string for iris value

iris_pos: int Property(int)

Iris position (0-255)

gain_mode: str Property(str)

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

gain_value: str Property(str)

Gain value

gain_pos: int Property(int)

Gain value as an integer from -6 to 24

shutter_mode: str Property(str)

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

shutter_value: str Property(str)

Shutter value

master_black: str Property(str)

MasterBlack value

master_black_pos: int Property(int)

MasterBlack value as an integer from -50 to 50

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

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

Debug method

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

Bases: jvconnected.device.ParameterGroup

Paint parameters

Properties
white_balance_mode: str Property(str)

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

color_temp: str Property(str)

White balance value

red_scale: int Property(int)

Total range for WB red paint (0-64)

red_pos: int Property(int)

Current position of WB red paint (0-64)

red_value: str Property(str)

WB red paint value

red_normalized: int Property(int)

Red value from -31 to +31

blue_scale: int Property(int)

Total range for WB blue paint (0-64)

blue_pos: int Property(int)

Current position of WB blue paint (0-64)

blue_value: str Property(str)

WB blue paint value

blue_normalized: int Property(int)

Blue value from -31 to +31

detail: str Property(str)

Detail value as string

detail_pos: int Property(int)

Detail value as an integer from -10 to +10

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: jvconnected.device.ParameterGroup

Tally light parameters

Properties
program: bool Property(bool)

True if program tally is lit

preview: bool Property(bool)

True if preview tally is lit

tally_priority: str Property(str)

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

tally_status: str Property(str)

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

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