redvypr.devices.network.iored.Device

class redvypr.devices.network.iored.Device(*args: Any, **kwargs: Any)

iored device

__init__(**kwargs)

Methods

__init__(**kwargs)

address_from_datakey(datakey)

Returns a datastream string from the datakey and self.address :param key:

address_string([strtype])

Returns the address string of the device Returns:

change_name(name)

Changes the name of the device

compare_zmq_subscription(subscription)

Compares if a redvypr_address is already subscribed or needs to be subscribed because a remote device is fitting the address :param subscription: redvypr address

connect_host(url_connect)

Connects to a remote host :param url_connect:

finalize_init()

Dummy function, can be defined by the user.

get_datastreams([local])

get_device_info()

Returns a deepcopy that is saved in self.statistics['device_redvypr'] containing information about all devices that have been sent by this device.

get_deviceaddresses([local])

Returns a list with redvypr_addresses of all devices that publish data via this device. This is in many cases the device itself but can also forwarded devices (i.e. iored) or because the device publishes data with different devicenames:: dataqueue.put({'count': i}) # Devicename as the device itself dataqueue.put({'count': i+10,'_redvypr':{'device':'test2'}}) # Devicename is 'test2'.

get_devices_by_host()

Sorts the forwarded devicelist by remote host and returns a dictionary :returns: Dictionary with the hostnames as keys with a device_redvypr entry

get_info()

Returns a dictionary with the essential info of the device Returns:

get_remote_device_info_legacy([if_changed])

param if_changed:

get_subscribed_deviceaddresses()

List of redvypr devices addresses this device has subscribed.

get_subscribed_devices()

Returns all redvypr.devices this device is subscribed to.

get_thread_status()

Returns:

got_subscribed(dataprovider_address, ...)

Function is called by self.redvypr if this device is connected with another one.

got_unsubscribed(dataprovider_address, ...)

param dataprovider_address:

kill_process()

print_info()

Displays information about the device

publishing_to()

returns:

List of devices this device is publishing to

query_host(url_query)

Querying a remote host :param url_query:

send_deviceinfo_command()

Sends a deviceinfoall command to the thread Returns:

send_hostinfo_command()

Sends a deviceinfoall command to the thread Returns:

start(device_info, config, dataqueue, ...)

Custom start function :param device_info: :param config: :param dataqueue: :param datainqueue: :param statusqueue:

subscribe_address(address[, force])

Subscribes to address :param address: :param force:

subscribe_all_remote()

Subscribes to all remote iored:redvypr devices Returns:

subscription_changed_global(devchange)

Function is called by redvypr after another device emitted the subscription_changed_signal

test_zmq_subscribe()

Tests if new zmq subscriptions have to be made.

test_zmq_unsubscribe()

Tests if zmq subscriptions are not neccesary anymore

thread_command(command[, data])

Sends a command to the device thread :param command: string, i.e. "stop" :param data: dictionary with additional data, the data will be incorporated into the command dict by executing command.update8(ata).

thread_start()

Starts the device thread, it calls the self.start function with the arguments

thread_stop()

Sends a stop command to the thread_communication queue Returns:

unsubscribe_address(address)

unsubscribe_all()

unsubscribe_all_remote()

unsubscribes from all remote iored:redvypr devices Returns:

zmq_connect(uuid)

Connects to a remote iored device, that means that a thread is started (start_zmq_sub) that is continously reading the zmq.sub socket of the remote device as well as a zmq.req socket to send requests to the device.

zmq_disconnect(uuid)

zmq_subscribe(uuid, substring)

Subscribe command to a remote iored device with address.

zmq_unsubscribe(uuid, substring)

Unsubscribe address from a remote iored device.

Attributes

subscription_changed_signal