GuyKh / ims-custom-component

The Israel Meteorological Service (IMS) integration component for home assistant
MIT License
44 stars 8 forks source link

[FR] City list instead of filling it manuall from hard coded list #26

Closed elad-bar closed 15 hours ago

elad-bar commented 1 year ago

thanks for releasing that component, following endpoint will reterive list of supported cities, users will not need to get familiar with their city code: GET https://ims.gov.il/en/locations_info

even nicer feature can be to identify it based on the HA location as each location in the response holds the coordinates of it, below is subset of cities from the list (left only 3 for the huge response):

{
    "data": {
        "1": {
            "lid": "1",
            "name": "Jerusalem",
            "lat": "31.7780",
            "lon": "35.2000",
            "zoom": "1",
            "height": "780",
            "is_park": "0"
        },
        "2": {
            "lid": "2",
            "name": "Tel Aviv - Yafo",
            "lat": "32.0821",
            "lon": "34.7802",
            "zoom": "1",
            "height": "30",
            "is_park": "0"
        },
        "3": {
            "lid": "3",
            "name": "Haifa",
            "lat": "32.7900",
            "lon": "34.9900",
            "zoom": "1",
            "height": "250",
            "is_park": "0"
        }
    },
    "method": "GET"
}

please consider adding it thanks

GuyKh commented 1 year ago

I'm not sure I understand what you're suggesting; Automatic detecation of location (instead of specifying it manually during configuration)

elad-bar commented 1 year ago

Option 1 - present list of cities dynamically from the list available in ims for the configuration Option 2 - auto identify Option 3 - combination of the options above, list from the endpoint, auto selection based on HA coordinates

GuyKh commented 15 hours ago

Implemented :)