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

[ICBINV] Regex for segment colors expects single rgba hex value instead of comma separated list #358

Open
FHeilmann opened this issue Nov 16, 2022 · 1 comment
Labels
bug Something isn't working ICantBelieveItsNotValetudo ICantBelieveItsNotValetudo Addon

Comments

@FHeilmann
Copy link

Which addon?
I can't believe it's not valetudo

Describe the bug
ICBINV uses a comma separated list of values for the segment colors
(see default here: https://github.com/Hypfer/ICantBelieveItsNotValetudo/blob/master/lib/MapDrawer.js#L37)

The hassio addon uses the same regex for segments as it does for the other map colors (which expect single hex rgba values link

As a result, the addon rejects "valid" inputs for the segments option (e.g. ["#19A1A1", "#7AC037", "#DF5618", "#F7C841"]) while inputs that satisfy the regex (e.g. "#AABBCC") will cause the internal ICBINV app to fail, because it expected a comma-separated list instead of a single value.

To Reproduce
a)

  1. Go to addon configuration
  2. In section "mapColors" add segments: "#ffffff" and save
  3. Scroll down to log
  4. Observe internal error

b)

  1. Go to addon configuration
  2. In section "mapColors" add segments: ["#19A1A1", "#7AC037", "#DF5618", "#F7C841"] and click save
  3. Observe addon configuration error due to regex mismatch

Expected behavior
Using segments: ["#19A1A1", "#7AC037", "#DF5618", "#F7C841"] yields the expected behavior and produces no regex errors
Using segments: "#ffffff" produces a configuration error instead of an internal error in the app

Screenshots
error for case a):
image

error for case b):
image

System

  • Supervisor version: 2022.10.2
  • Host system version: HassOS 9.0
@FHeilmann FHeilmann added the bug Something isn't working label Nov 16, 2022
@Poeschl Poeschl added the ICantBelieveItsNotValetudo ICantBelieveItsNotValetudo Addon label Nov 16, 2022
@github-actions
Copy link

Hi, there.

Please make sure you have the right addon for your software.
The addon you mentioning is the companion for ICantBelieveItsNotValetudo from Hypfer.


This is an automated comment. Responding to the bot or mentioning it won't have any effect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ICantBelieveItsNotValetudo ICantBelieveItsNotValetudo Addon
Projects
None yet
Development

No branches or pull requests

2 participants