-
-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RamsesClimateEntityDescription.__init__() missing 1 required keyword-only argument: 'extra_attributes' #119
Comments
I have pulled |
Should be optional? |
I am not familiar with this: @dataclass(kw_only=True)
class RamsesEntityDescription(EntityDescription):
"""Class describing Ramses entities."""
has_entity_name: bool = True
extra_attributes: list[str] = field(default_factory=list) # dict? |
Odd. It works fine for me. These are the docs for creating a new list for the dataclass. It's a list, not a dict as it is a list of device properties to expose as attributes. |
But: RamsesBinarySensorEntityDescription(
key="active_fault",
name="Active fault",
rf_class=Logbook,
entity_class=RamsesLogbookBinarySensor,
device_class=BinarySensorDeviceClass.PROBLEM,
extra_attributes={ # this is a dict
ATTR_ACTIVE_FAULT: "active_fault",
ATTR_LATEST_EVENT: "latest_event",
ATTR_LATEST_FAULT: "latest_fault",
}, |
🤦 Yes, you're absolutely correct. The default should be a dict (type |
...but doesn't solve my problem. |
We don't actually need it to default to an empty dict. I'm confused as to why that's not working for you but does the following work instead?
|
Well. I had tried extra_attributes: dict[str, str] | None = field(default_factory=dict) ... which didn't work, but your suggestion does! |
I'll push that. |
We're both running dev branch of HA, with Python 3.11.6, right? |
I've been running on a slightly out of date dev branch of HA (Dec 3) running with the provided devcontainer which has Python 3.11.4. I also tested on my main install of 2023.12.3. I'll update to latest dev for good measure. |
@trvrnrth
This is what I'm seeing:
The text was updated successfully, but these errors were encountered: