redvypr.device.redvypr_device¶
- class redvypr.device.redvypr_device(*args: Any, **kwargs: Any)¶
- __init__(name='redvypr_device', uuid='', redvypr=None, dataqueue=None, comqueue=None, datainqueue=None, statusqueue=None, template={}, config={}, publishes=False, subscribes=False, multiprocess='tread', startfunction=None, loglevel='INFO', numdevice=-1, statistics=None, autostart=False, devicemodulename='')¶
Methods
__init__([name, uuid, redvypr, dataqueue, ...])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
Dummy function, can be defined by the user.
get_datastreams([local])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:
List of redvypr devices addresses this device has subscribed.
Returns all redvypr.devices this device is subscribed to.
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:
Displays information about the device
- returns:
List of devices this device is publishing to
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).
Starts the device thread, it calls the self.start function with the arguments
Sends a stop command to the thread_communication queue Returns:
unsubscribe_address(address)Attributes
subscription_changed_signal