RuntimeError and TypeError when trying to call wm.event_timer_add

I'm currently working on a script for blender and I used the Modal Timer Template. The problem is that one line is constantly giving me errors.

Here the source code:

def execute(self, context):
wm = context.window_manager
return {'RUNNING_MODAL'}


And I get the output message:

Traceback (most recent call last):
File "/home/tobias/Datenablage/Programmieren/python/Artnet_Visualizer/Blender_implementation.blend/sniffer_timed.py", line 62, in <module>
File "/home/tobias/Temp/blender-2.80-f36efe0e2ad-linux-glibc224-x86_64/2.80/scripts/modules/bpy/ops.py", line 200, in __call__
ret = op_call(self.idname_py(), None, kw)
RuntimeError: Error: Traceback (most recent call last):
File "/home/tobias/Datenablage/Programmieren/python/Artnet_Visualizer/Blender_implementation.blend/sniffer_timed.py", line 41, in execute
TypeError: WindowManager.event_timer_add(): required parameter "window" to be a keyword argument!


I'm kinda new to scripting in Blender so I have no idea what I should do.

• There are many changes in 2.80 and it appears this could be one. Given the error message try wm.event_timer_add(0.1, window=context.window) ie make it a keyword argument. Oct 2 '18 at 17:13
There are many changes in 2.80 and it appears this could be one. Given the error message try wm.event_timer_add(0.1, window=context.window) ie make it a keyword argument.
• Worth also mentioning. A keyword argument has a default, (Haven't checked but) Most probable default in this case is context.window. If this is the case can use wm.event_timer_add(0.1) Oct 3 '18 at 11:22