async def get_sensor(client, sensor_name):
    """Get last sensor value (in encoded form), or None if no value."""
    reply, informs = await client.request('sensor-value', sensor_name)
    assert reply == [b'1']
    status = informs[0].arguments[3]
    value = informs[0].arguments[4]
    if status in {b'nominal', b'warning', b'error'}:
        return value
    else:
        return None