
My idea to optimize this is to make a function that gets device “name” as a variable, and then I could make this a single function. My problem is that I don’t know what parameter I should put inside my function brackets, and how to connect that function to Subscribe?