Skip to content

Commit

Permalink
just realized that attributes must always be a dictionary
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbarcelo committed Jan 24, 2023
1 parent 5d961d4 commit 7ddbd4a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ham/things.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from abc import ABCMeta, abstractmethod
import json
from typing import Union, TYPE_CHECKING, ClassVar, Any
from typing import Union, TYPE_CHECKING, ClassVar

# LiteralString is from Python 3.11;
# atm, we want to support Python 3.9
Expand Down Expand Up @@ -74,7 +74,7 @@ def attributes(self):
raise AttributeError("Attributes is write-only by design")

@attributes.setter
def attributes(self, attributes: Any):
def attributes(self, attributes: dict):
"""Publish the JSON attributes of this entity."""
self.publish_mqtt_message(bytes(json.dumps(attributes), "utf-8"), "attrs")

Expand Down

0 comments on commit 7ddbd4a

Please sign in to comment.