File: belkin_wemo.py

package info (click to toggle)
python-netdisco 2.8.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 508 kB
  • sloc: python: 1,532; xml: 247; sh: 10; makefile: 8
file content (19 lines) | stat: -rw-r--r-- 665 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
"""Discover Belkin Wemo devices."""
from . import SSDPDiscoverable
from ..const import ATTR_MAC_ADDRESS


class Discoverable(SSDPDiscoverable):
    """Add support for discovering Belkin WeMo platform devices."""

    def info_from_entry(self, entry):
        """Return most important info from a uPnP entry."""
        info = super().info_from_entry(entry)
        device = entry.description['device']
        info[ATTR_MAC_ADDRESS] = device.get('macAddress', '')
        return info

    def get_entries(self):
        """Return all Belkin Wemo entries."""
        return self.find_by_device_description(
            {'manufacturer': 'Belkin International Inc.'})