Commit Graph

51 Commits (cb37df6a619afc167ae758796b8cd980d8e0ee39)

Author SHA1 Message Date
Franck Nijhof b0cee0bc46
String formatting and max line length - Part 1 (#84390)
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2022-12-22 10:12:50 +01:00
GitHub Action f19a1147fe [ci skip] Translation update 2022-12-11 00:26:24 +00:00
GitHub Action f25017313a [ci skip] Translation update 2022-12-09 00:24:29 +00:00
GitHub Action 1f3e5fb4fc [ci skip] Translation update 2022-12-07 00:24:08 +00:00
GitHub Action 0d1f476bee [ci skip] Translation update 2022-12-01 00:33:36 +00:00
HarvsG fe7402375d
Bayesian - support `unique_id:` (#79879)
* support unique_id

* adds test for unique_ids
2022-10-25 12:42:59 +02:00
GitHub Action 000e092096 [ci skip] Translation update 2022-10-14 00:37:00 +00:00
HarvsG b86927a453
Enable strict typing on Bayesian (#79870)
* make bayesian static

* no longer private
2022-10-09 20:30:38 +02:00
HarvsG 9d351a3c10
Improve typing and code quality in beyesian (#79603)
* strict typing

* Detail implication

* adds newline

* don't change indenting

* really dont change indenting

* Update homeassistant/components/bayesian/binary_sensor.py

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>

* typing in async_setup_platform() + remove arg

* less ambiguity

* mypy thinks Literal[False] otherwise

* clearer log

* don't use `and` assignments

* observations not values

* clarify can be None

* observation can't be none

* assert we have at least one

* make it clearer where we're using UUIDs

* remove unnecessary bool

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>

* Unnecessary None handling

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>

* Better type setting

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>

* Reccomended changes.

* remove if statement not needed

* Not strict until _TrackTemplateResultInfo fixed

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2022-10-07 22:23:25 +02:00
GitHub Action 558b327928 [ci skip] Translation update 2022-10-06 00:31:54 +00:00
GitHub Action 8d28da83ca [ci skip] Translation update 2022-10-05 00:36:50 +00:00
HarvsG dd1463da28
Refactor bayesian observations using dataclass (#79590)
* refactor

* remove some changes

* remove typehint

* improve codestyle

* move docstring to comment

* < 88 chars

* avoid short var names

* more readable

* fix rename

* Update homeassistant/components/bayesian/helpers.py

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>

* Update homeassistant/components/bayesian/binary_sensor.py

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>

* Update homeassistant/components/bayesian/binary_sensor.py

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>

* no intermediate

* comment why set before list

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2022-10-04 17:16:39 +02:00
GitHub Action 12358f2446 [ci skip] Translation update 2022-10-03 00:31:05 +00:00
GitHub Action 13c8d22baf [ci skip] Translation update 2022-10-02 00:37:00 +00:00
GitHub Action bd5ec4e198 [ci skip] Translation update 2022-10-01 00:40:08 +00:00
GitHub Action 21b078eeb7 [ci skip] Translation update 2022-09-30 00:42:29 +00:00
HarvsG f645965172
Add repair for missing Bayesian `prob_given_false` (#79303) 2022-09-29 13:24:06 -04:00
HarvsG 768b83139f
Add to issue registry if user has mirrored entries for breaking in #67631 (#79208)
Co-authored-by: Diogo Gomes <diogogomes@gmail.com>
2022-09-28 21:39:15 -04:00
HarvsG 49eeeae51d
Fix Bayesian sensor to use negative observations (#67631)
Co-authored-by: Diogo Gomes <diogogomes@gmail.com>
2022-09-25 22:02:35 -04:00
epenet dedf063e43
Improve entity type hints [b] (#77012) 2022-08-19 09:54:13 +02:00
epenet 4a84a8caa9
Use Platform enum (#76967) 2022-08-18 10:22:49 +02:00
epenet fbabad1d1d
Add binary_sensor setup type hints [a-f] (#63268)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2022-01-03 13:10:41 +01:00
Robert Hillis 77c68cb507
Use entity class attributes for bayesian (#52831) 2021-07-11 16:37:41 -04:00
tkdrob 6f5629cf14
Add targets and selectors for services (B-C) (#50189) 2021-05-14 13:38:41 +02:00
Franck Nijhof 055cdc64c0
Add support for IoT class in manifest (#46935) 2021-04-15 10:21:38 +02:00
Erik Montnemery 6c084ae6ce
Update integrations a-e to override extra_state_attributes() (#47756) 2021-03-11 16:51:03 +01:00
Franck Nijhof a80921ab65
Minor service definition tweaks (#46741) 2021-02-18 17:14:36 +01:00
Anders Melchiorsen f27066e773
Raise ConditionError for state errors (#46244) 2021-02-09 09:46:36 +01:00
Anders Melchiorsen b9b1caf4d7
Raise ConditionError for numeric_state errors (#45923) 2021-02-08 10:47:57 +01:00
J. Nick Koston 44952a94cf
Add missing conext preservation to bayesian and universal (#40178)
We already do this for template sensors, but it was
missing for bayesian and universal
2020-09-17 16:47:23 +02:00
J. Nick Koston a495946eeb
Add the ability to reload bayesian platforms from yaml (#39771) 2020-09-08 09:41:17 +02:00
J. Nick Koston a77e09b2c2
Make async_track_template_result track multiple templates (#39371)
* Make async_track_template_result track multiple templates

Combine template entity updates to only write ha
state once per template group update

* Make async_track_template_result use dataclasses for input/output

* black versions

* naming
2020-08-31 19:07:40 -05:00
J. Nick Koston b68c5cec94
Convert bayesian binary_sensor to use async_track_template_result (#39174)
Add coverage to reach 100% line coverage
2020-08-23 09:59:26 +02:00
J. Nick Koston 5cd6370822
Switch async_track_state_change to the faster async_track_state_change_event part 3 (#37852)
async_track_state_change_event is faster than async_track_state_change
2020-07-14 09:40:01 -10:00
Franck Nijhof 4cf186a47e
Small collection of random styling tweaks, fixes and Pythonism (#35390) 2020-05-09 00:10:17 +02:00
Erik Montnemery b022e08db9
Rename BinarySensorDevice to BinarySensorEntity (#34462)
* Rename BinarySensorDevice to BinarySensorEntity

* Tweak

* Move deprecation warning to __new__, add test

* Move deprecation warning back to __init__

* Move deprecation warning to __init_subclass
2020-04-23 21:57:07 +02:00
Jeff McGehee dcf51e5a14
Fix Bayesian Binary JSON Serialization (#34540) 2020-04-22 11:25:14 -07:00
Carlos Gustavo Sarmiento d510384c0d
Remove print() from Bayesian Binary Sensor (#33916) 2020-04-09 21:37:53 +02:00
springstan d7e3b0b755
Clean up access to config in various integrations v2 (#33763) 2020-04-07 22:45:56 +02:00
Franck Nijhof 7d3c974747
Use set & dict literals (#33636)
Co-authored-by: Daniel Høyer Iversen <mail@dahoiv.net>
2020-04-04 20:05:15 +02:00
Paulus Schoutsen f1d3c0d19b
Remove unused manifest fields (#33595) 2020-04-03 12:58:19 -07:00
Jeff McGehee dd1608db0d
Best effort state initialization of bayesian binary sensor (#30962)
* Best effort state initialization of bayesian binary sensor.

Why:

* https://github.com/home-assistant/home-assistant/issues/30119

This change addresses the need by:

* Running the main update logic eagerly for each entity being observed
  on `async_added_to_hass`.
* Test of the new behavior.

* Refactor in order to reduce number of methods with side effects that
mutate instance attributes.

* Improve test coverage

Why:

* Because for some reason my commits decreased test coverage.

This change addresses the need by:

* Adding coverage for the case where a device returns `STATE_UNKNOWN`
* Adding coverage for configurations with templates

* rebase and ensure upstream tests passed

* Delete commented code from addressing merge conflict.
2020-03-31 10:41:29 -06:00
paolog89 0e6a48c688
Add observed entities to bayesian sensor (#27721)
* Add observed entities to bayesian sensor

* Update binary_sensor.py to comply with style guidelines and test_binary_sensor.py to verify the entity_id

* Update binary_sensor.py and test_binary_sensor.py to include an additional attribute for observed entities

* Use of ATTR_ENTITY_ID and numeric key of observed entity

* Update binary_sensor.py

* Update test_binary_sensor.py to verify behavior

* Update to return a list without duplicates in the state attribute

* Update binary_sensor.py: rename of ATTR_ENTITY_ID into ATTR_OBSERVED_ENTITIES

* Rename new attribute into ATTR_OCCURRED_OBSERVATION_ENTITIES and fix test
2020-02-24 21:27:59 -08:00
Franck Nijhof bfa0edaf92 Migrate Integration Quality Scale from docs to manifest: internal (#30551) 2020-01-07 20:58:49 +01:00
sophof 078a7e446d Fix all entities triggering all observations in bayesian sensor (#28979)
* change fromkeys to dict comprehension to prevent append working on a list by reference. Now each entity id has its own seperate list

* change fromkeys to dict comprehension to prevent append working on a list by reference. Now each entity id has its own seperate list

* use get instead of direct keys for dict

* change fromkeys to dict comprehension to prevent append working on a list by reference. Now each entity id has its own seperate list

* use get instead of direct keys for dict

* changed get back to []
2019-11-26 11:26:40 -08:00
Ville Skyttä 761d7f21e9 Upgrade pylint (#27279)
* Upgrade pylint to 2.4.2 and astroid to 2.3.1

https://pylint.readthedocs.io/en/latest/whatsnew/2.4.html
https://pylint.readthedocs.io/en/latest/whatsnew/changelog.html#what-s-new-in-pylint-2-4-1
https://pylint.readthedocs.io/en/latest/whatsnew/changelog.html#what-s-new-in-pylint-2-4-2

* unnecessary-comprehension fixes

* invalid-name fixes

* self-assigning-variable fixes

* Re-enable not-an-iterable

* used-before-assignment fix

* invalid-overridden-method fixes

* undefined-variable __class__ workarounds

https://github.com/PyCQA/pylint/issues/3090

* no-member false positive disabling

* Remove some no longer needed disables

* using-constant-test fix

* Disable import-outside-toplevel for now

* Disable some apparent no-value-for-parameter false positives

* invalid-overridden-method false positive disables

https://github.com/PyCQA/pylint/issues/3150

* Fix unintentional Entity.force_update override in AfterShipSensor
2019-10-07 08:17:39 -07:00
Franck Nijhof c7da781efc Update documentation link URL for integrations in all manifests (#27114) 2019-10-02 09:25:44 -07:00
Paulus Schoutsen 4de97abc3a Black 2019-07-31 12:25:30 -07:00
Paulus Schoutsen cfe4cf30ad
Add manifests (#22699)
* Add manifests

* Update auto name

* Update codeowners

* Add requirements from platforms

* Minor cleanup

* Incorporate changes from awarecan PR
2019-04-03 21:14:45 -07:00
Tobias Sauerwein 048b100eea Clean up docstrings (#22679)
* Clean up docstrings

* Fix long lines

* Fix more docstrings

* Fix more docstrings

* Fix more docstrings
2019-04-03 17:40:03 +02:00