California law requires residential rental property owners to deliver and maintain their rental units in a habitable condition, this legal principle is called the warranty of habitability. Though originally created by the California Supreme Court in 1974, the California Legislature has codified many of the principles of the warranty of habitability in the Civil Code. A residential rental property owner who fails to provide habitable premises risks code enforcement action by their local government, being sued by their tenants, having the cost of repair deducted from the rent, and losing unlawful detainer actions based on non-payment of rent.