That looks like a DTH posted here and was a quick rewrite from SmartThings that just ignored the method.
You could comment out capability "Refresh"
, but probably safer adding the following if some application is expecting the refresh() method:
def refresh() {
log.debug "${device.displayName} called refresh"
}
The Virtual momentary switch thread is updated with the change and curious enough refresh() is discussed here.