Allow switches to expose additional attributes apart from switch state

Fix https://github.com/pimatic/pimatic/issues/321