File tree 5 files changed +23
-11
lines changed
5 files changed +23
-11
lines changed Original file line number Diff line number Diff line change 1
1
// See https://aka.ms/vscode-remote/devcontainer.json for format details.
2
2
{
3
3
"image" : " ludeeus/container:integration-debian" ,
4
- "name" : " Blueprint integration development" ,
4
+ "name" : " HA KNMI development" ,
5
5
"context" : " .." ,
6
6
"appPort" : [
7
7
" 9123:8123"
16
16
"settings" : {
17
17
"files.eol" : " \n " ,
18
18
"editor.tabSize" : 4 ,
19
- "terminal.integrated.shell .linux" : " /bin/ bash" ,
19
+ "terminal.integrated.defaultProfile .linux" : " bash" ,
20
20
"python.pythonPath" : " /usr/bin/python3" ,
21
21
"python.analysis.autoSearchPaths" : false ,
22
22
"python.linting.pylintEnabled" : true ,
Original file line number Diff line number Diff line change 4
4
"python.pythonPath" : " /usr/local/bin/python" ,
5
5
"files.associations" : {
6
6
"*.yaml" : " home-assistant"
7
- }
7
+ },
8
+ "python.testing.pytestArgs" : [
9
+ " tests"
10
+ ],
11
+ "python.testing.unittestEnabled" : false ,
12
+ "python.testing.pytestEnabled" : true
8
13
}
Original file line number Diff line number Diff line change 1
1
MIT License
2
2
3
- Copyright (c) 2021 golles
3
+ Copyright (c) 2022 golles
4
4
5
5
Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
of this software and associated documentation files (the "Software"), to deal
Original file line number Diff line number Diff line change 7
7
from homeassistant .components .binary_sensor import (
8
8
DEVICE_CLASS_SAFETY ,
9
9
)
10
+ from homeassistant .components .sensor import (
11
+ STATE_CLASS_MEASUREMENT ,
12
+ ATTR_STATE_CLASS ,
13
+ )
10
14
from homeassistant .components .weather import (
11
15
ATTR_CONDITION_CLEAR_NIGHT ,
12
16
ATTR_CONDITION_CLOUDY ,
20
24
ATTR_CONDITION_SUNNY ,
21
25
)
22
26
23
- # Todo, import next: from homeassistant.components.sensor import SensorStateClass
24
- MEASUREMENT = "measurement"
25
-
26
27
# Base component constants.
27
28
NAME = "KNMI"
28
29
DOMAIN = "knmi"
72
73
"device_class" : DEVICE_CLASS_TEMPERATURE ,
73
74
"attributes" : [
74
75
{
75
- "name" : "state_class" ,
76
- "value" : MEASUREMENT ,
76
+ "name" : ATTR_STATE_CLASS ,
77
+ "value" : STATE_CLASS_MEASUREMENT ,
77
78
},
78
79
],
79
80
},
85
86
"device_class" : DEVICE_CLASS_TEMPERATURE ,
86
87
"attributes" : [
87
88
{
88
- "name" : "state_class" ,
89
- "value" : MEASUREMENT ,
89
+ "name" : ATTR_STATE_CLASS ,
90
+ "value" : STATE_CLASS_MEASUREMENT ,
90
91
},
91
92
],
92
93
},
Original file line number Diff line number Diff line change @@ -129,6 +129,11 @@ def forecast(self):
129
129
if super ().getData (f"d{ i } windkmh" ) is not None
130
130
else None
131
131
)
132
+ sun_chance = (
133
+ float (super ().getData (f"d{ i } zon" ))
134
+ if super ().getData (f"d{ i } zon" ) is not None
135
+ else None
136
+ )
132
137
next_day = {
133
138
ATTR_FORECAST_TIME : date .isoformat (),
134
139
ATTR_FORECAST_CONDITION : condition ,
@@ -137,6 +142,7 @@ def forecast(self):
137
142
ATTR_FORECAST_PRECIPITATION : precipitation ,
138
143
ATTR_FORECAST_WIND_BEARING : wind_bearing ,
139
144
ATTR_FORECAST_WIND_SPEED : wind_speed ,
145
+ "sun_chance" : sun_chance ,
140
146
}
141
147
forecast .append (next_day )
142
148
You can’t perform that action at this time.
0 commit comments