41 lines
968 B
Python
41 lines
968 B
Python
#!/usr/bin/env python
|
|
# Based on the work of https://github.com/leiweibau/Pi.Alert
|
|
|
|
# python3 /home/pi/pialert/front/plugins/website_monitor/script.py urls=http://google.com,http://bing.com
|
|
|
|
import sys
|
|
import pathlib
|
|
|
|
from plugin_helper import Plugin_Objects
|
|
|
|
sys.dont_write_bytecode = True
|
|
|
|
curPath = str(pathlib.Path(__file__).parent.resolve())
|
|
log_file = curPath + '/script.log'
|
|
result_file = curPath + '/last_result.log'
|
|
|
|
FAKE_DEVICES = ["routerXX","hubZZ"]
|
|
|
|
|
|
def main():
|
|
print("Hello")
|
|
|
|
devices = Plugin_Objects( result_file )
|
|
|
|
|
|
for fake_dev in FAKE_DEVICES:
|
|
devices.add_object(fake_dev, fake_dev, fake_dev, fake_dev, "", "", "", "")
|
|
|
|
#for obj in devices.objects:
|
|
# print(obj.write())
|
|
|
|
devices.write_result_file()
|
|
|
|
return 0
|
|
|
|
|
|
#===============================================================================
|
|
# BEGIN
|
|
#===============================================================================
|
|
if __name__ == '__main__':
|
|
main() |