„main.py“ ändern

This commit is contained in:
Manuel Kamper 2023-04-09 18:40:32 +00:00
parent dda937611f
commit 6630078686
1 changed files with 10 additions and 4 deletions

14
main.py
View File

@ -412,11 +412,17 @@ async def TCSBusWriter(message):
async def ExternalAPI(action):
Logger.LogMessage("External API action: " + action)
if (action == "doorbell"):
response = requests.get(configs['fhem_door_ringed'])
response.close()
if (configs['fhem_door_ringed'] is not ""):
response = requests.get(configs['fhem_door_ringed'])
response.close()
else:
Logger.LogMessage("Warning: No fhem_door_ringed setting!")
elif (action == "frontdoorbell"):
response = requests.get(configs['fhem_frontdoor_ringed'])
response.close()
if (configs['fhem_frontdoor_ringed'] is not ""):
response = requests.get(configs['fhem_frontdoor_ringed'])
response.close()
else:
Logger.LogMessage("Warning: No fhem_frontdoor_ringed setting!")
else:
Logger.LogMessage("Error: Unknown ExternalAPI action!")
pass