With a 24 hour notice (or 48), yes it is legal. They can post notice and come by merely to inspect the state of the property.
(Paraphrased from CA Civ Code 1954)
A landlord may enter the dwelling unit only in the following cases:
- In case of emergency.
- To make necessary or agreed repairs, exhibit the property, or perform move in/out inspections.
- When the tenant has abandoned or surrendered the premises.
- Pursuant to court order.
It is what it is.