def is_switched_on(self, refresh=False):
if refresh:<EOL><INDENT>self.refresh()<EOL><DEDENT>val = self.get_value('<STR_LIT>')<EOL>return val == '<STR_LIT:1>'<EOL>
Get switch state.

        Refresh data from Vera if refresh is True, otherwise use local cache.
        Refresh is only needed if you're not using subscriptions.