Hello All! I was gifted a Hubitat Elevation for Christmas, and am finally getting around to using it. I am new to HE and Home Automation in general. However, I do have some software development experience.
Background:
I am trying to develop a device driver to control some cheap Feit Electric bulbs that I got at Costco.
https://www.amazon.com/Feit-Electric-Smart-Changing-Dimmable/dp/B07RL48PFF/ref=asc_df_B07RL48PFF/
I installed/flashed the bulb with Tasmota 8.0.1.2. As of right now, I am planning on using HTTP, but might switch over to a MQTT based solution depending on how well this works. This is what I have so far: HubitatAppsAndDrivers/TasmotaHttpFeitBulbDriver.groovy at master · megbers/HubitatAppsAndDrivers · GitHub
I got this far by basing the code off of others work and modifying as needed. I can get it turn off and on and set the color of the bulb and have it sync to the color with that of the Color Bulb tile in the DashBoard App. (I do have a javascript error in the dashboard I created, but I will post that to a different topic)
Now for my question:
I can tell, obviously, when the on() method is called from the UI, but what I cannot tell is when the refresh() or ** initialize()** methods should be called. I have also seen some examples with update() methods implemented. Does anyone know if there is any documentation that I am missing about when these methods will be called and/or what they should be doing? I have found the "java doc" type documentation for the the Capabilities, but that really doesn't tell you much besides the method signature.
When and by what do those methods (initialize, refresh, update) get called. I can call them manually by going to the device screen and clicking the buttons, but shouldn't those be called automatically by the framework? I am doing something wrong in my code to prevent those methods from getting triggered?
Same thing with the parse() method. I can tell by the logs that it is getting called, but my code doesn't explicitly call it anywhere. So, something is calling that method some time after the HTTP request is complete. Is that called by the hubitat.device.HubAction class or the framework?
NOTE: I could be thinking about this totally wrong, too, so please be gentle.