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

Rename visibility custom entity configuration to visibility_entity #252

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

pawelma
Copy link

@pawelma pawelma commented Oct 4, 2024

WHAT

Renames the visibility card option config variable to visibility_entity.

⚠️ It will introduce breaking change for people who were using visibility custom sensor. After this change it will have to be renamed to visibility_entity⚠️

WHY

So that it won't clash with visibility card configuration in home assistant.
The clash were making card fail when any condition for native HA visibility were set.

HA visibility screen Card alternative entities before change Card alternative entities after change
image image image

Config yaml prior the change:

type: custom:weather-chart-card
entity: weather.house
show_main: false
show_temperature: false
show_current_condition: false
show_attributes: true
show_time: false
show_time_seconds: false
show_day: false
show_date: false
show_humidity: false
show_pressure: false
show_wind_direction: false
show_wind_speed: false
show_sun: false
show_feels_like: false
show_dew_point: false
show_wind_gust_speed: false
show_visibility: true
show_last_changed: false
use_12hour_format: false
icons_size: 25
animated_icons: false
icon_style: style1
autoscroll: false
forecast:
  precipitation_type: rainfall
  show_probability: false
  labels_font_size: "11"
  precip_bar_size: "100"
  style: style1
  show_wind_forecast: false
  condition_icons: false
  round_temp: false
  type: daily
  number_of_forecasts: "1"
  disable_animation: false
units:
  speed: ""
visibility:
  condition: screen
  media_query: "(min-width: 768px)"

Config yaml after the change:

type: custom:weather-chart-card
entity: weather.house
show_main: false
show_temperature: false
show_current_condition: false
show_attributes: true
show_time: false
show_time_seconds: false
show_day: false
show_date: false
show_humidity: false
show_pressure: false
show_wind_direction: false
show_wind_speed: false
show_sun: false
show_feels_like: false
show_dew_point: false
show_wind_gust_speed: false
show_visibility: true
show_last_changed: false
use_12hour_format: false
icons_size: 25
animated_icons: false
icon_style: style1
autoscroll: false
forecast:
  precipitation_type: rainfall
  show_probability: false
  labels_font_size: "11"
  precip_bar_size: "100"
  style: style1
  show_wind_forecast: false
  condition_icons: false
  round_temp: false
  type: daily
  number_of_forecasts: "1"
  disable_animation: false
units:
  speed: ""
visibility:
  - condition: screen
    media_query: "(min-width: 768px)"
visibility_entity: sensor.fan_speed

Card not rendered before change when visibility condition (not visibility card options) filled:
image

Card rendered after change:
image

So that it won't clash with  visibility card configuration in home assistant.
@folfy
Copy link

folfy commented Nov 8, 2024

I think ideally all "alternative sensor" attributes would be grouped into a dedicated dictionary, similar to the "forecast" entity, which would allow preserving a consist naming convention. This would be a bigger change and break all sensor attributes tho, so would be good to at least merge this PR, to fix both visibility condition and visibility entity attributes with HA 2024.6+

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

Successfully merging this pull request may close these issues.

3 participants