How can i get the properties like ccd-temperature within a Python script.
I have this code so far:
import dbus
from dbus.mainloop.glib import DBusGMainLoop
DBusGMainLoop(set_as_default=True)
from gi.repository import GObject as gobject
import os
import time
#
# Create a session bus.
bus = dbus.SessionBus()
# Create an object that will proxy for a particular remote object.
remote_object = bus.get_object("org.kde.kstars", # Connection name
"/KStars/INDI" # Object's path
)
# Introspection returns an XML document containing information
# about the methods supported by an interface.
print ("Introspection data:\n")
#print (remote_object.Introspect())
# Get INDI interface
iface = dbus.Interface(remote_object, 'org.kde.kstars.INDI')
print ("Hello, Python!")
devices = iface.getDevices()
print ("We received the following devices:")
for device in devices:
print (device)
#props = iface.GetAll('org.kde.kstars.INDI')
props = iface.getText("OpenWeatherMap", "WEATHER_TEMPERATURE")
print ("Temperature: ", props)
naam = os.getenv('USER')
#naam = os.getenv(`indi_getprop -1 "OpenWeatherMap.WEATHER_STATUS.WEATHER_TEMPERATURE"`)
print ("The user is:", naam)
But i get the error:
TypeError: More items found in D-Bus signature than in Python arguments