mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-31 07:03:55 +00:00 
			
		
		
		
	Fix validation TypeError (#574)
This commit is contained in:
		| @@ -78,8 +78,12 @@ def indexbytes(buf, i): | ||||
| if IS_PY2: | ||||
|     def decode_text(data, encoding='utf-8', errors='strict'): | ||||
|         # type: (str, str, str) -> unicode | ||||
|         if isinstance(data, unicode): | ||||
|             return data | ||||
|         return unicode(data, encoding=encoding, errors=errors) | ||||
| else: | ||||
|     def decode_text(data, encoding='utf-8', errors='strict'): | ||||
|         # type: (bytes, str, str) -> str | ||||
|         if isinstance(data, str): | ||||
|             return data | ||||
|         return data.decode(encoding=encoding, errors=errors) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user