Closed Wire-Fox closed 5 months ago
can you check if master version has the same behaviour?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
This issue was closed because it has been stalled for 5 days with no activity.
Describe the issue
While trying to utilize some of the entity attributes in the TrueNAS integration, I encountered issues getting these to process due to the names of some of the attributes containing spaces. These can be parsed when templating, but cannot consistently be parsed in yaml configurations. I specifically could not process attributes in auto-entities-card without just doing my entire filter selection with Templating.
How to reproduce the issue
Expected behavior
Expected to see values more like:
Screenshots
N/A
Software versions
Diagnostics data
None seen.
Traceback/Error logs
None seen.
Additional context
I was exploring the code base of the integration to see if there was any clear explanation for this behavior. I am not an experienced coder, so my findings here may be of little value. Hopefully they actually are helpful!
binary_sensor_types.py defines the attributes in the manner I expect for the Apps entities (Line 74).
helper.py defines the format_attribute function, which seems to rename elements of gathered attributes into more human-readable formats. (Line 7 through 19)
entity.py calls the format_attribute variable in a block starting at line 202. My experience fails me here, but I suspect this returns the full string of formatted attributes in the extra_state_attributes variable. What is noteworthy to me is it looked like one the only calls to store these attribute values, which has them being stored in the formatted manner.