Implementation of polling may need further fine tuning, but basic functionality works (tested on esp8266).