Library: discovery

From Yombo
Jump to: navigation, search
discovery
Commonly Used Yes
Status Active

Summary
Auto device discovery management.

Introduction

Offloads much of the work for managing auto discovered devices. Allows the user to quickly add new devices using information already provided by a module.

Modules can supply configuration variable information when the device is discovered so that the user can enter minimal information to setup the new device.


Hooks

No hooks registered.

Usage

The primary method to call is new(). This quickly creates a new discovered device, see examples for complete usage information.

Examples

id_hash = "%s:%s" % (serial, address) # create a unique ID for this device.
device_type = self._DeviceTypes['zwave_dimmer']
self._Discovery.new(**{
    'source': "Zwave",
    'device_id': id_hash,
    'display_description': 'Zwave - %s %s' % (node.manufacturer_name, node.product_name),
    'description': '%s %s' % (node.manufacturer_name, node.product_name),
    'mfr': node.manufacturer_name,
    'model': node.product_id,
    'serial': "%s:%s" % (network.home_id, node.node_id),
    'label': '',
    'machine_label': '',
    'device_type': device_type,
    'variables': {
        'poll_intensity': 5,
        'home_id': str(network.home_id),
        'node_id': str(node.node_id),
        },
    'yombo_device': yombo_device,
    'notification_title': 'New Zwave device found',
    'notification_message': 'The Zwave module found a new Zwave device. <p>Type: %s<br>Node Id: %s<br>Manufacturer: %s<br>Product ID: %s<br>' %
               (node.product_name, node.node_id, node.manufacturer_name, node.product_id),
})


This page was last edited on 28 March 2018.