'Test converting event to db state.'

def test_from_event(self):

    state = ha.State('sensor.temperature', '18')
    event = ha.Event(EVENT_STATE_CHANGED, {'entity_id': 'sensor.temperature', 'old_state': None, 'new_state': state})
    assert (state == States.from_event(event).to_native())
