I developed a pretty nifty python library that possibly someone might be willing to code a Domoticz interface for
https://github.com/kdschlosser/UPNP_Device
it basically scans a network discovering all UPNP devices. and builds a python object that represents the device (based on IP) it supports embedded devices and nested upnp service. maps out the data types and builds methods for the upnp function calls. check to ensure the proper data type is being used. provides return data types and names for the returned data, as well as parameter names. It is a pretty quick implementation discovers all devices typically in less then 4 seconds.
maybe it could be useful.
I have developed a cool python library
Moderator: leecollings
-
- Posts: 15
- Joined: Sunday 23 April 2017 3:14
- Target OS: Windows
- Domoticz version:
- Contact:
Re: I have developed a cool python library
Hi, looks good any info in install and usage ? Looks like setup.py is missing
-
- Posts: 15
- Joined: Sunday 23 April 2017 3:14
- Target OS: Windows
- Domoticz version:
- Contact:
Re: I have developed a cool python library
I need to create a new branch and merge my most recent changes. I forgot to do that.
I will have it updated in a second.
I will have it updated in a second.
-
- Posts: 15
- Joined: Sunday 23 April 2017 3:14
- Target OS: Windows
- Domoticz version:
- Contact:
Re: I have developed a cool python library
the usage is really simple.
or if you have a static IP of a device you want to specifically target
you can also adjust the timeout
doing the print will spit out the information for every service/device/method/data type basically all of the information you would want to know.
You can iterate over specific devices and services like so
with UPNP the devices and services can be nested.
and if you want to iterate the functions of a service
I can get into quite a bit of detail on how to get the data types for the parameters that are used in the functions if needed. But that is a good start there. You should be able to tinker about a bit.
Code: Select all
import UPNP_Device
for device in UPNP_Device.discover():
print(device)
Code: Select all
import UPNP_Device
for device in UPNP_Device.discover(ip='192.168.1.1'):
print(device)
Code: Select all
import UPNP_Device
for device in UPNP_Device.discover(timeout=10):
print(device)
You can iterate over specific devices and services like so
Code: Select all
import UPNP_Device
for device in UPNP_Device.discover(timeout=10):
for service in device.services:
print(service.__name__)
Code: Select all
import UPNP_Device
for device in UPNP_Device.discover(timeout=10):
for service in device.services:
print(service.__name__)
for service in service.services:
print(' ', service.__name__)
for embedded_device in device.devices:
print embedded_device.__name__
for service in embedded_device.services:
print(' ', serviice.__name__)
and if you want to iterate the functions of a service
Code: Select all
import UPNP_Device
for device in UPNP_Device.discover(timeout=10):
for service in device.services:
print(service.__name__)
for action in service.actions:
print(' ', action.__name__)
I can get into quite a bit of detail on how to get the data types for the parameters that are used in the functions if needed. But that is a good start there. You should be able to tinker about a bit.
Who is online
Users browsing this forum: No registered users and 1 guest