mirror of
https://github.com/jdejaegh/irm-kmi-ha.git
synced 2025-06-27 11:39:26 +02:00
Start with hardcoded values
This commit is contained in:
parent
4c2d0d80ec
commit
aff79f709c
3 changed files with 42 additions and 0 deletions
1
custom_components/irm_kmi/__init__.py
Normal file
1
custom_components/irm_kmi/__init__.py
Normal file
|
@ -0,0 +1 @@
|
||||||
|
"""Integration for IRM KMI weather"""
|
11
custom_components/irm_kmi/manifest.json
Normal file
11
custom_components/irm_kmi/manifest.json
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
"domain": "irm_kmi",
|
||||||
|
"name": "IRM KMI Weather Belgium",
|
||||||
|
"codeowners": ["@jdejaegh"],
|
||||||
|
"dependencies": [],
|
||||||
|
"documentation": "https://github.com/jdejaegh/irm-kmi-ha/",
|
||||||
|
"integration_type": "service",
|
||||||
|
"iot_class": "cloud_polling",
|
||||||
|
"requirements": [],
|
||||||
|
"version": "0.1.0"
|
||||||
|
}
|
30
custom_components/irm_kmi/weather.py
Normal file
30
custom_components/irm_kmi/weather.py
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
import logging
|
||||||
|
from homeassistant.components.weather import WeatherEntity
|
||||||
|
from homeassistant.components.weather import ATTR_CONDITION_PARTLYCLOUDY
|
||||||
|
from homeassistant.const import UnitOfTemperature
|
||||||
|
|
||||||
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||||
|
add_devices([IrmKmiWeather()])
|
||||||
|
_LOGGER.warning("Irm KMI setup")
|
||||||
|
|
||||||
|
|
||||||
|
class IrmKmiWeather(WeatherEntity):
|
||||||
|
|
||||||
|
@property
|
||||||
|
def name(self) -> str:
|
||||||
|
return "IRM KMI Weather"
|
||||||
|
|
||||||
|
@property
|
||||||
|
def condition(self) -> str | None:
|
||||||
|
return ATTR_CONDITION_PARTLYCLOUDY
|
||||||
|
|
||||||
|
@property
|
||||||
|
def native_temperature(self) -> float | None:
|
||||||
|
return 20.2
|
||||||
|
|
||||||
|
@property
|
||||||
|
def native_temperature_unit(self) -> str:
|
||||||
|
return UnitOfTemperature.CELSIUS
|
Loading…
Add table
Reference in a new issue