ich bekomms einfach nicht gebacken die Group description einer gruppe auszulesen, hat jemand einen Tipp?
group_getObjects(id="test") gibt mir keine object-attribute für description....
VG
Andreas
Lösung:
Kompletter Code unter: https://github.com/kratzersmz/opsi-teska-wakeup
Code: Alles auswählen
.....
wakeupsactive = backending.group_getObjects(id="wakeup",description="on")
# check if wakeup is active(True)
isactive = True
try:
test = wakeupsactive[0]
except IndexError:
isactive = False
if isactive:
wakeups = backending.group_getObjects(parentGroupId="wakeup")
for wakeup in wakeups:
# check it time fits to wakeup-name, e.g. 07-00
if (currenttime == wakeup.id):
# check if wakeups weekday is empty. If so, assume 1..5.
if len(wakeup.description) == 0 and int(currentweekday) in range(1,5):
wakeGroup(backending,wakeup.id)
# if currentweekday is in string wakeupdays in description for wakeup, e.g. wakeup description 1,3,6 (Monday, Wednesday, Saturday)
elif str(currentweekday) in wakeup.description:
wakeGroup(backending,wakeup.id)