As described in Xiaomi Air Purifier - Show all sensors and Switches in UI and HomeKit sometimes it is useful to make case-insensitive comparisons. For example, in the thread linked a device accepts status changes which are capitalised, but return states which are lowercase.
How to compare or convert strings to/with different case?