Skip to content
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

Remove utf-8 characters in sensor attributes #295

Closed
bakerkj opened this issue Dec 6, 2023 · 7 comments
Closed

Remove utf-8 characters in sensor attributes #295

bakerkj opened this issue Dec 6, 2023 · 7 comments

Comments

@bakerkj
Copy link

bakerkj commented Dec 6, 2023

In sensor.device_name_altitude it includes the following attributes:
» mi - location 1: 12.61138
» mi - location 2: 15.8523
» mi - location 3: 31.98394

This includes the U+00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK character (»)

This breaks the the home assistant graphite integration (home-assistant/core#103083).

Would it be possible to replace these unicode characters with an ascii character?

@bakerkj bakerkj changed the title utf-8 characters in sensor attributes Remove utf-8 characters in sensor attributes Dec 6, 2023
@gcobb321
Copy link
Owner

gcobb321 commented Dec 7, 2023

I've changed the utf-8 characters to ascii characters. unzip the sensor.xip file to the icloud3directory and restart HA. Let me know how it works.

sensor.zip

@bakerkj
Copy link
Author

bakerkj commented Dec 8, 2023

Will do. Thank you!

@bakerkj
Copy link
Author

bakerkj commented Dec 8, 2023

@gcobb321 it looks like in addition to the fix for utf-8 -> ascii there changes in sensor.py that depend on changes in other files that I don't have. Here is the traceback.

Thanks!

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 215, in _async_setup_component
    component = integration.get_component()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 816, in get_component
    ComponentProtocol, importlib.import_module(self.pkg_path)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/config/custom_components/icloud3/__init__.py", line 42, in <module>
    from .                              import config_flow
  File "/config/custom_components/icloud3/config_flow.py", line 70, in <module>
    from .                  import sensor as ic3_sensor
  File "/config/custom_components/icloud3/sensor.py", line 43, in <module>
    from .helpers.time_util import (time_to_12hrtime, time_remove_am_pm, secs_to_time_str, mins_to_time_str,
ImportError: cannot import name 'adjust_time_hour_value' from 'custom_components.icloud3.helpers.time_util' (/config/custom_components/icloud3/helpers/time_util.py)


@gcobb321
Copy link
Owner

gcobb321 commented Dec 8, 2023

I’ll send you the complete rc9, which hasn’t been released yet, Friday morning

@gcobb321
Copy link
Owner

Unzip icloud3_v3-rc9.zip into the icloud3 directory and restart HA.

There are a lot of updates, bug fixes and new features. Review ChangeLog.txt for a complete list. They are at the top under the rc9 heading.

icloud3_v3-rc9.zip

@bakerkj
Copy link
Author

bakerkj commented Dec 12, 2023

@gcobb321 this looks good. Thank you!

@bakerkj
Copy link
Author

bakerkj commented Feb 29, 2024

I think we can close this out.

@bakerkj bakerkj closed this as completed Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants