Giter Site home page Giter Site logo

splinter98 / btsmarthub_devicelist Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jxwolstenholme/btsmarthub_devicelist

0.0 1.0 0.0 59 KB

Retrieve a list of devices from a bt smarthub or bt smarthub 2 on a local network

License: MIT License

Python 100.00%

btsmarthub_devicelist's Introduction

BT Smarthub Device List v.0.2.1

Python package allowing for a BT Smart Hub or BT Smart Hub 2 router to be queried for devices. The package will output either all devices stored in the router's memory or just the devices connected at present as a list of dicts with the following keys:

  • UserHostName (Device Name)
  • PhysAddress (MAC Address)
  • IPAddress (Last Known IP of Device)
  • Active (Boolean for if the Device is Connected to the Router)

For use with a BT Smart Hub 2, set the smarthub_model flag to 2, for a BT Smart Hub 1 set the smarthub_model flag to 1. If you are not sure, leave the flag blank and it will attempt to determine the hub type.

If the router is a BT Smart Hub 2 and you set the include_connections flag to True then the additional keys will additionally be populated:

  • ConnectionType (Ether | 2G | 5G fixed/wifi 2.4Ghz/wifi 5Ghz)
  • ParentName (Name of parent device is connecting through - e.g. wifi disks name)
  • ParentPhysAddress ( MAC Address of the parent)

NB. If a device hasn't been connected for a while, is a disk or the router itself then the additional fields may be set to 'Unknown'

Seeking PR for the following devices:

BT Smart Hub (Home Hub 6B)

Installation

$ pip install btsmarthub_devicelist

Example

from btsmarthub_devicelist import BTSmartHub
smarthub = BTSmartHub(router_ip='192.168.1.254', smarthub_model=1)
device_list = smarthub.get_devicelist(only_active_devices=True, include_connections=True)
print(devicelist)

btsmarthub_devicelist's People

Contributors

d0ugal avatar jxwolstenholme avatar leroyshirto avatar paulgoulbourn avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.