redvypr.devices.network.network_device.Device

class redvypr.devices.network.network_device.Device(*args: Any, **kwargs: Any)
__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

check_and_fill_config()

Fills a config, if essential entries are missing

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_info()

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

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

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

param device_info:

status()

subscribe_address(address[, force])

Subscribes to address :param address: :param force:

subscription_changed_global(devchange)

Function is called by redvypr after another device emitted the subscription_changed_signal

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()

Attributes

subscription_changed_signal