mawaqit / home-assistant

Mawaqit integration - salat time and nearest mosque - in Home Assistant
60 stars 16 forks source link

Use `time` display option instead of `date_time` #28

Closed itsabdelrahman closed 1 year ago

itsabdelrahman commented 1 year ago

Home Assistant's Time & Date integration already supports the time format, so one doesn't have to use the date_time format and then extract the time manually using split.

Hours & minutes

{{ states("sensor.date_time").split(" ")[1] }} {# 08:37 #}
{{ states("sensor.time") }} {# 08:37 #}

Minutes

{{ states("sensor.date_time").split(":")[1] }} {# 37 #}
{{ states("sensor.time").split(":")[1] }} {# 37 #}
ibrahim-zehhaf-mawaqit commented 1 year ago

@itsabdelrahman could you please fix the conflict

ibrahim-zehhaf-mawaqit commented 1 year ago

@hajtux could you please check this PR and test it