'Return true if the binary sensor is on.'

@property
def is_on(self):

    if (self.rest.data is None):
        return False
    response = self.rest.data
    if (self._value_template is not None):
        response = self._value_template.async_render_with_possible_json_value(self.rest.data, False)
    try:
        return bool(int(response))
    except ValueError:
        return {'true': True, 'on': True, 'open': True, 'yes': True}.get(response.lower(), False)
