90 Commits

Author SHA1 Message Date
Joakim Plate
a1cdd91d23
Continue transition from legacy dict to attr in dsmr (#121906) 2024-07-22 21:41:24 +02:00
Joakim Plate
42610f4e09
Add diagnostic information to DSMR (#122041)
* Add diagnostic information to DSMR

Switches to runtime_data to get access
to the last telegram received.

* Correct import of domain

* Apply suggestions from code review

Co-authored-by: G Johansson <goran.johansson@shiftit.se>

---------

Co-authored-by: G Johansson <goran.johansson@shiftit.se>
2024-07-18 11:57:11 +02:00
Joakim Plate
a0d0e0f4a9
Correct deprecated telegram usage in dsmr (#121847) 2024-07-12 16:00:27 +02:00
Marc Mueller
2f0dd6f704
Import Generator from collections.abc (2) (#120915) 2024-07-01 11:58:49 +02:00
epenet
cbb3d48bd9
Improve type hints in dsmr tests (#120393) 2024-06-25 13:11:27 +02:00
epenet
e57bac6da8
Fix confusing-with-statement pylint warnings (#119364) 2024-06-11 15:03:03 +02:00
epenet
2c7022950c
Fix import-outside-toplevel pylint warnings in tests (#119389) 2024-06-11 14:57:50 +02:00
epenet
0b01326f9f
Use is in ConfigEntryState enum comparison in tests (A-M) (#114925) 2024-04-05 17:16:55 +02:00
Joost Lekkerkerker
b9281327c4
Use FlowResultType enum in config flow tests A-M (#114681) 2024-04-03 09:21:17 +02:00
Joost Lekkerkerker
9b41e3d124
Use is in enum comparison in config flow tests A-E (#114669) 2024-04-02 11:22:05 -10:00
Jan-Philipp Benecke
0238c2ea9e
Use device registry mock instead of hass.helpers in dsmr tests (#114535) 2024-04-01 00:41:06 +02:00
Joost Lekkerkerker
6bb4e7d62c
Bump ruff to 0.3.4 (#112690)
Co-authored-by: Sid <27780930+autinerd@users.noreply.github.com>
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-03-26 00:02:16 +01:00
Sid
727581eea3
Add first batch of Ruff PT rules (#113665)
* Add first batch of Ruff PT rules

* fix weather test

* Fix pilight test

* Update test_intent.py

* Update pilight test_init.py

* Update test_init.py
2024-03-18 13:26:14 +01:00
Marc Mueller
32f3f46542
Add empty line after module docstring (2) [tests.components] (#112737) 2024-03-08 19:16:21 +01:00
Marc Mueller
38adfbf1a3
Add empty line after module docstring [tests a-e] (#112708) 2024-03-08 08:50:25 -05:00
Joost Lekkerkerker
7ad1d3e891
Add icon translations to DSMR (#111411)
* Add icon translations to DSMR

* Add icon translations to DSMR
2024-02-28 12:55:43 +01:00
dupondje
0aaa517217
add missing state class to dsmr sensors (#110712)
current_average_demand and maximum_demand_current_month are missing a state class, which gives errors in the statistics tab in HA.
So adding them to the sensor.
2024-02-16 12:08:09 +01:00
Marc Mueller
c82933175d
Use builtin TimeoutError [a-d] (#109678) 2024-02-05 11:31:33 +01:00
Jan Bouwhuis
5d6791e412
Remove CONF_PRECISION remainder from dsmr (#104919) 2023-12-03 11:53:09 +01:00
Jan Bouwhuis
c9306049b3
Correct SerialException import in dsmr, firmata, landysgyr_heat_meater and rfxtrx integrations (#104889)
* Fix SerialException import in dsmr integration

* Fix imports firmata, landysgyr_heat_meter, rfxtrx
2023-12-02 19:30:04 +01:00
Jan Bouwhuis
5106dd173c
Fix dsmr zero reconnect interval option could crash HA (#104900)
* Fix dsmr zero interval option could crash HA

* No change change the options
2023-12-02 19:28:56 +01:00
Jan Bouwhuis
7767bb328d
Filter out zero readings for DSMR enery sensors (#104843) 2023-11-30 23:42:51 +01:00
dupondje
ba481001c3
Add support for multiple mbus devices in dsmr (#84097)
* Add support for multiple mbus devices in dsmr

A dsmr meter can have 4 mbus devices.
Support them all and also add support for a water meter on the mbus
device.

* Apply suggestions from code review

Co-authored-by: Jan Bouwhuis <jbouwh@users.noreply.github.com>

* Rewrite old gas sensor to new mbus sensor

* No force updates + fix mbus entity unique_id

* Remove old gas device

* Add additional tests

* Fix remarks from last review + move migrated 5b gas meter to new device_id

* Fix ruff error

* Last fixes

---------

Co-authored-by: Jan Bouwhuis <jbouwh@users.noreply.github.com>
2023-11-29 15:41:58 +01:00
Jan-Philipp Benecke
81450f0117
Update d-e* tests to use entity & device registry fixtures (#103804) 2023-11-12 10:38:32 +01:00
dupondje
4f11ee6e0b
Fix 5B Gas meter in dsmr (#103506)
* Fix 5B Gas meter in dsmr

In commit 1b73219 the gas meter broke for 5B.
As the change can't be reverted easily without removing the peak usage
sensors, we implement a workaround.

The first MBUS_METER_READING2 value will contain the gas meter data just
like the previous BELGIUM_5MIN_GAS_METER_READING did.
But this without the need to touch dsmr_parser (version).

Fixes: #103306, #103293

* Use parametrize

* Apply suggestions from code review

Co-authored-by: Jan Bouwhuis <jbouwh@users.noreply.github.com>

* Add additional tests + typo fix

---------

Co-authored-by: Jan Bouwhuis <jbouwh@users.noreply.github.com>
2023-11-08 09:13:51 +01:00
Joost Lekkerkerker
b636a4d5cf
Parametrize DSMR serial config flow tests (#103524) 2023-11-07 14:13:57 +01:00
dupondje
91182603d5
Use right equipment identifier in DSMR setup (#103494) 2023-11-06 14:19:47 +01:00
dupondje
da653c36fd
Add peak usage sensors to dsmr (#102227) 2023-10-20 15:59:34 +02:00
Jan Bouwhuis
9db9f1b8a9
Fix suggested UOM cannot be set for dsmr entities (#102134)
* Supply dsmr entities jit on first telegram

* Stale docstr

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Simplify tuple type

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2023-10-19 19:22:03 +02:00
dupondje
1b73219137
Bump dsmr_parser to 1.3.0 (#102225)
bump dsmr_parser==1.3.0
2023-10-18 18:13:09 +02:00
Joakim Plate
ae7930c0ad
Use entity translation in dsmr (#93017)
* Use entity translation in dsmr

* Combine a few strings
2023-05-17 22:31:04 +02:00
Franck Nijhof
ed79265843
Enable Ruff PT006 (#88165)
* Enable Ruff PT006

* Adjust existing cases

* Fix tests

* Remove unneeded parentheses
2023-02-15 14:09:50 +01:00
epenet
728f62b1ec
Add type hints to integration tests (part 5) (#87850) 2023-02-12 19:39:48 +01:00
epenet
3052de3e8e
Add type hints to integration tests (d-e) (#87699) 2023-02-08 13:01:44 +01:00
epenet
4142f0d15d
Add return type to tests without arguments (#87613)
* Add return type to tests without arguments

* Black

* Cancel fixture amends
2023-02-07 14:20:06 +01:00
Michael
2850583085
Replace the usage of unit constants by enumerations in Tests [a-e] (#85932) 2023-01-15 14:44:01 +01:00
Franck Nijhof
4a48f0d659
Fix device class for DSMR gas sensors providing energy readings (#85202) 2023-01-05 20:28:13 +01:00
Franck Nijhof
02f64ada2d
Only reflect unavailable state in DSMR when disconnected (#84862)
* Only reflect unavailable state in DSMR when disonnected

* Addressreview comment
2022-12-30 13:08:11 -05:00
Franck Nijhof
1b3d3d5cc3
Add availability property to DSMR sensors (#84848) 2022-12-30 16:21:41 +01:00
Jelte Zeilstra
298ea3ff46
Add enum device class and translations to DSMR Active tariff sensor (#84253) 2022-12-21 23:26:56 +01:00
Franck Nijhof
b62ebbe974
Migrate DSMR to new entity naming style (#75077) 2022-07-20 11:30:08 +02:00
Franck Nijhof
397f94ee50
Migrate DSMR to use keys for entity unique ID (#74895) 2022-07-12 20:06:13 +02:00
Franck Nijhof
7cd68381f1
Search/replace RESULT_TYPE_* by FlowResultType enum (#74642) 2022-07-07 19:57:36 +03:00
Franck Nijhof
99f68ab858
Update dsmr_parser to v0.33 (#71946) 2022-05-16 21:04:59 -07:00
rhpijnacker
0c2b5b6c12
Support DSMR data read via RFXtrx with integrated P1 reader (#63529)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-03-26 16:46:33 +01:00
rhpijnacker
bb762d5b0f
100% code coverage for config_flow of dsmr component (#65238) 2022-02-07 10:48:33 +01:00
Gunnar Klauberg
0f2e2aef2f
Add DSMR config options for EasyMeter/Q3D (#63669)
Co-authored-by: Rob Bierbooms <mail@robbierbooms.nl>
2022-01-10 13:08:41 +01:00
rhpijnacker
32c416b646
Bump dsmr-parser dependency to 0.32 (#63436) 2022-01-05 22:50:00 +01:00
Franck Nijhof
5efb88f3f1
Remove deprecated YAML configuration from DSMR (#61008) 2021-12-05 17:09:37 +01:00
Franck Nijhof
58fdcfb6b8
Use device/state class enums in DSMR (#60791) 2021-12-01 22:15:17 -05:00