Merge "Update light/dark detection." into tm-dev