My city is conducting its once-every-5-years housing inspection. Inspections are outside-only, but they encompass quite a lot- roof, walls, yard, electrical, foundation, door locks & hinges- a full page of items in tiny 9 point font. Most of what they are inspecting can probably be done from the curb, but they do mention they will "come to your door prior to the inspection."
I've no objection to them inspecting from the curb, and they can probably accomplish most of their goals from that alone. But I would not be surprised to find them roaming my yard. (This is the kind of city that measures your lawn with a ruler to enforce the landscaping code.) It feels very invasive and kind of pushy.
My question is: does a city have any legal basis for entering a property for housing code inspections? Does the 4th Amendment apply here? I imagine that it would be considered trespassing if I told them to leave, and they refused. I also understand that this will likely cause me more headaches than if I simply let them do their thing. But it feels wrong.