Mine's a little more sophisticated than that, but it boils down to the same thing. When the door state changes, change the image using set_graphic.