Add icon translations to Zodiac (#112369)
parent
4a22415c2d
commit
1cc58f217b
|
@ -0,0 +1,22 @@
|
||||||
|
{
|
||||||
|
"entity": {
|
||||||
|
"sensor": {
|
||||||
|
"sign": {
|
||||||
|
"default": "mdi:zodiac-aries",
|
||||||
|
"state": {
|
||||||
|
"taurus": "mdi:zodiac-taurus",
|
||||||
|
"gemini": "mdi:zodiac-gemini",
|
||||||
|
"cancer": "mdi:zodiac-cancer",
|
||||||
|
"leo": "mdi:zodiac-leo",
|
||||||
|
"virgo": "mdi:zodiac-virgo",
|
||||||
|
"libra": "mdi:zodiac-libra",
|
||||||
|
"scorpio": "mdi:zodiac-scorpio",
|
||||||
|
"sagittarius": "mdi:zodiac-sagittarius",
|
||||||
|
"capricorn": "mdi:zodiac-capricorn",
|
||||||
|
"aquarius": "mdi:zodiac-aquarius",
|
||||||
|
"pisces": "mdi:zodiac-pisces"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -145,21 +145,6 @@ ZODIAC_BY_DATE = (
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
ZODIAC_ICONS = {
|
|
||||||
SIGN_ARIES: "mdi:zodiac-aries",
|
|
||||||
SIGN_TAURUS: "mdi:zodiac-taurus",
|
|
||||||
SIGN_GEMINI: "mdi:zodiac-gemini",
|
|
||||||
SIGN_CANCER: "mdi:zodiac-cancer",
|
|
||||||
SIGN_LEO: "mdi:zodiac-leo",
|
|
||||||
SIGN_VIRGO: "mdi:zodiac-virgo",
|
|
||||||
SIGN_LIBRA: "mdi:zodiac-libra",
|
|
||||||
SIGN_SCORPIO: "mdi:zodiac-scorpio",
|
|
||||||
SIGN_SAGITTARIUS: "mdi:zodiac-sagittarius",
|
|
||||||
SIGN_CAPRICORN: "mdi:zodiac-capricorn",
|
|
||||||
SIGN_AQUARIUS: "mdi:zodiac-aquarius",
|
|
||||||
SIGN_PISCES: "mdi:zodiac-pisces",
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
async def async_setup_entry(
|
async def async_setup_entry(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
|
@ -211,6 +196,5 @@ class ZodiacSensor(SensorEntity):
|
||||||
today.month == sign[1][1] and today.day <= sign[1][0]
|
today.month == sign[1][1] and today.day <= sign[1][0]
|
||||||
):
|
):
|
||||||
self._attr_native_value = sign[2]
|
self._attr_native_value = sign[2]
|
||||||
self._attr_icon = ZODIAC_ICONS.get(sign[2])
|
|
||||||
self._attr_extra_state_attributes = sign[3]
|
self._attr_extra_state_attributes = sign[3]
|
||||||
break
|
break
|
||||||
|
|
Loading…
Reference in New Issue