diff --git a/src/controller/python/chip/clusters/Types.py b/src/controller/python/chip/clusters/Types.py index 2359705010ec49..cb420eec7cb646 100644 --- a/src/controller/python/chip/clusters/Types.py +++ b/src/controller/python/chip/clusters/Types.py @@ -15,7 +15,6 @@ # limitations under the License. # - class Nullable(): def __repr__(self): return 'Null' @@ -32,5 +31,13 @@ def __ne__(self, other): def __lt__(self, other): return True + def __hash__(self): + ''' Explicitly implement __hash__() to imply immutability when used in + dataclasses. + + See also: https://docs.python.org/3/library/dataclasses.html#dataclasses.dataclass + ''' + return 0 + NullValue = Nullable()