'Test if source is below threshold.'

def test_sensor_lower(self):

    config = {'binary_sensor': {'platform': 'threshold', 'threshold': '15', 'name': 'Test_threshold', 'type': 'lower', 'entity_id': 'sensor.test_monitored'}}
    assert setup_component(self.hass, 'binary_sensor', config)
    self.hass.states.set('sensor.test_monitored', 16)
    self.hass.block_till_done()
    state = self.hass.states.get('binary_sensor.test_threshold')
    self.assertEqual('lower', state.attributes.get('type'))
    assert (state.state == 'off')
    self.hass.states.set('sensor.test_monitored', 14)
    self.hass.block_till_done()
    state = self.hass.states.get('binary_sensor.test_threshold')
    assert (state.state == 'on')
    self.hass.states.set('sensor.test_monitored', 15)
    self.hass.block_till_done()
    state = self.hass.states.get('binary_sensor.test_threshold')
    assert (state.state == 'off')
