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: strProperty(str)
serial_number: strProperty(str)
resolution: strProperty(str)
api_version: strProperty(str)
parameter_groups: dictDictProperty(dict)

Container for ParameterGroup instances

connected: boolProperty(bool)

Connection state

device_index: intProperty(int)

The device index

error: boolProperty(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 devicepreviewJpegSource [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: strProperty(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: strProperty(str)

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

mode: strProperty(str)

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

timecode: strProperty(str)

The current timecode value

menu_status: boolProperty(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: strProperty(str)

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

level_str: strProperty(str)

Numeric value indicating various charging/discharging states

value_str: strProperty(str)

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

state: BatteryStateProperty(BatteryState)

The current battery state as a member of BatteryState

minutes: intProperty(int)

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

percent: intProperty(int)

Capacity remaining. If unavailable, this will be -1

voltage: floatProperty(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: strProperty(str)

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

iris_mode: strProperty(str)

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

iris_fstop: strProperty(str)

Character string for iris value

iris_pos: intProperty(int)

Iris position (0-255)

gain_mode: strProperty(str)

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

gain_value: strProperty(str)

Gain value

gain_pos: intProperty(int)

Gain value as an integer from -6 to 24

shutter_mode: strProperty(str)

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

shutter_value: strProperty(str)

Shutter value

master_black: strProperty(str)

MasterBlack value

master_black_pos: intProperty(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: strProperty(str)

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

color_temp: strProperty(str)

White balance value

red_scale: intProperty(int)

Total range for WB red paint (0-64)

red_pos: intProperty(int)

Current position of WB red paint (0-64)

red_value: strProperty(str)

WB red paint value

red_normalized: intProperty(int)

Red value from -31 to +31

blue_scale: intProperty(int)

Total range for WB blue paint (0-64)

blue_pos: intProperty(int)

Current position of WB blue paint (0-64)

blue_value: strProperty(str)

WB blue paint value

blue_normalized: intProperty(int)

Blue value from -31 to +31

detail: strProperty(str)

Detail value as string

detail_pos: intProperty(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: boolProperty(bool)

True if program tally is lit

preview: boolProperty(bool)

True if preview tally is lit

tally_priority: strProperty(str)

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

tally_status: strProperty(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