Closed marianheinsen closed 4 years ago
In general fritzconnection can access every service and action provided by AVM. In case of WOL this can be done like (with fc
as a FritzConnection
instance):
# get info:
addr = '00:17:F2:04:XX:XX' # device MAC address
info = fc.call_action('Hosts1',
'X_AVM-DE_GetAutoWakeOnLANByMACAddress',
NewMACAddress=addr)
print(info)
# set state:
args = {
'NewMACAddress': addr,
'NewAutoWOLEnabled': 0, # 1 [off|on]
}
fc.call_action('Hosts1',
'X_AVM-DE_SetAutoWakeOnLANByMACAddress',
arguments=args)
Classes like FritzHosts
are just wrappers for calling (a subset of) actions and mainly serve as examples how to use FritzConnection
. However, the library modules can evolve with time. So it's possible to include the code above in one of the next releases.
FritzHosts include WOL support with version 1.3.0
Does the API already have WOL support? I couldn't find it in the FritzHosts class