Actually it should work fine. I just tried it and didn't have any problem setting a device state to a unicode string.
The problem, which we need to document better, is that
value as used in the XML here:
- Code: Select all
<List>
<Option value="fahrenKey">F, any XML encoded unicode string in here should be okay</Option>
<Option value="celsiusKey">C, any XML encoded unicode string in here should be okay</Option>
</List>
is not really a device state value string. It is the unique value key to identify that particular list item. Instead of
value we probably should have called it
id,
valueKey, or
valueID.
So the values you use there needs to follow the same rules as id's:
- id's can contain letters, numbers, and other ASCII characters
- id's cannot start with a number or punctuation character
- id's cannot start with the letters xml (or XML, or Xml, etc)
- id's cannot contain spaces
Note, however, that the value is not the same as an actual device state values. Those can contain any unicode characters. Depending on what you are doing, when you calculate the device state string you will probably have to convert between the value in the XML (that is the valueKey) and the actual unicode string state you want to set.