#6 UI Updates senden und anzeigen

This commit is contained in:
David Zingg 2019-11-20 21:14:42 +01:00
parent 79bc4eb897
commit 799c6b5406

View File

@ -50,13 +50,13 @@ class MyStromSwitchPlugin(octoprint.plugin.SettingsPlugin,
self._logger.info(self.ip)
self._logger.info(self.intervall)
self._logger.info("Starting timer.")
self._timer = RepeatedTimer(self.intervall, self._timer_task)
self._timer.start()
def _timer_task(self):
if self.ip is not None:
self._logger.debug("send Request")
try:
request = requests.get(
'http://{}/report'.format(self.ip), timeout=1)