Commit ffd13ff 1 parent be2399b commit ffd13ff Copy full SHA for ffd13ff
File tree 2 files changed +3
-3
lines changed
2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change 10
10
MQTT_PASSWORD_CONF_KEY = "ha_mqtt_password"
11
11
MQTT_RETAIN_CONF_KEY = "ha_mqtt_retain"
12
12
13
+ # https://www.home-assistant.io/integrations/sensor.mqtt/#expire_after
13
14
MQTT_EXPIRE_AFTER = 15 * 60 # 15 minutes
14
15
15
16
@@ -19,6 +20,3 @@ class MQTTConfiguration:
19
20
hostname : str
20
21
port : int
21
22
client_id : str = "Grott - HA"
22
-
23
-
24
- MQTT_EXPIRE_AFTER = 15 * 60 # 15 minutes
Original file line number Diff line number Diff line change
1
+ from grottext .ha .constants import MQTT_EXPIRE_AFTER
1
2
from grottext .ha .ha_types import to_dict
2
3
from grottext .ha .mappings import mapping
3
4
from grottext .ha .mqtt import MQTTConfigPayload , make_payload
@@ -18,6 +19,7 @@ def test_generate_payload(fake_config):
18
19
assert payload ["state_class" ] == "measurement"
19
20
assert payload ["device_class" ] == "power"
20
21
assert payload ["unit_of_measurement" ] == "W"
22
+ assert payload ["expire_after" ] == MQTT_EXPIRE_AFTER
21
23
22
24
23
25
def test_generate_log_type_payload (fake_config ):
You can’t perform that action at this time.
0 commit comments