Commit Graph

52 Commits (e15eda3aa26bad430a437b4efb42d7efa4472784)

Author SHA1 Message Date
Tsvi Mostovicz e82130e6fe
Bump hdate to 0.11.1 (#130456) 2024-11-22 15:06:31 +01:00
Jan Bouwhuis ee41725b53
Remove jewish_calendar yaml support after 6 months of deprecation (#130291) 2024-11-10 16:51:08 +01:00
G Johansson a2a3f59e65
Fix missing translation in jewish_calendar (#129822) 2024-11-04 18:01:39 +01:00
Tsvi Mostovicz 1b7fcce42d
Assert keys exist in Jewish calendar tests (#129295) 2024-10-28 12:23:45 +01:00
epenet f41494b7cc
Ensure config_flow abort reasons have translations (#128140)
* Ensure config_flow abort reasons have translations

* Ignore fake_integration in application_credentials

* Mark gardena_bluetooth as needs fixing

* Mark google as needs fixing

* Mark google_assistant_sdk as needs fixing

* Mark homewizard as needs fixing

* Mark homeworks as needs fixing

* Mark honeywell as needs fixing

* Mark jewish_calendar as needs fixing

* Mark lg_netcast as needs fixing

* Mark lifx as needs fixing

* Mark lyric as needs fixing

* Mark madvr as needs fixing

* Mark matter as needs fixing

* Mark melcloud as needs fixing

* Mark motioneye as needs fixing

* Mark ollama as needs fixing

* Mark philips_js as needs fixing

* Mark spotify as needs fixing

* Mark srp_energy as needs fixing

* Mark subaru as needs fixing

* Mark tplink as needs fixing

* Mark yolink as needs fixing

* Mark youtube as needs fixing

* Fix incorrect comment
2024-10-14 16:39:10 +02:00
epenet 3d1e57766a
Simplify jewish_calendar reconfigure flow (#128008)
* Simplify jewish_calendar reconfigure flow

* Adjust
2024-10-09 15:34:11 +02:00
epenet 9873371413
Use start_reconfigure_flow in config flow tests (#127191)
* Use start_reconfigure_flow in config flow tests

* Adjust fritz
2024-10-02 10:01:15 +02:00
Tsvi Mostovicz 52c358e120
Add reconfigure flow for Jewish Calendar (#126773)
* Add reconfigure flow for Jewish Calendar

* Use async_update_reload_and_abort
2024-09-28 13:59:11 +02:00
epenet e734971d33
Enable collections-named-tuple (PYI024) rule in ruff (#123019) 2024-08-02 15:28:32 +02:00
Tsvi Mostovicz f40897b54c
Add Jewish Calendar reconfiguration test (#118833)
* Revert "Remove flaky tests"

This reverts commit c4de9fdcbe.

* Change reconfigure test to be based on data

* Don't assert using internals

* Fix assertions to be on config entry
2024-07-11 11:17:12 +02:00
Marc Mueller 921430d497
Import Generator from collections.abc (3) (#120916) 2024-07-01 12:09:11 +02:00
Tsvi Mostovicz 29da88d8f6
Create a Jewish Calendar entity (#120253)
* Set has_entity_name to true

* Move common code to jewish calendar service entity

* Remove already existing assignment

* Move data to common entity

* Remove description name

* Use config entry title instead of name for the device

* Address comments
2024-06-23 19:55:27 +02:00
Tsvi Mostovicz 2cc34fd7e7
Improve Jewish calendar entities (#120236)
* By default don't enable all sensors

* Fix tests

* Add entity category

* Set has_entity_name to true

* Revert "Set has_entity_name to true"

This reverts commit 5ebfcde78a.
2024-06-23 17:26:45 +02:00
SLaks 2dfa0a3c90
Add Jewish Calendar attributes for non-date sensors (#116252) 2024-06-22 14:30:19 +02:00
Tsvi Mostovicz 369f9772f2
Fix Jewish Calendar unique id migration (#119683)
* Implement correct passing fix

* Keep the test as is, as it simulates the current behavior

* Last minor change
2024-06-17 12:37:30 +02:00
Marc Mueller 33ed4fd862
Import Generator from typing_extensions (3) (#118990) 2024-06-06 17:28:59 +02:00
Tsvi Mostovicz 98455cbd93
Fix updating options in Jewish Calendar (#118643) 2024-06-04 20:55:38 +02:00
Tsvi Mostovicz 12215c51b3
Fix Jewish calendar unique id's (#117985)
* Initial commit

* Fix updating of unique id

* Add testing to check the unique id is being updated correctly

* Reload the config entry and confirm the unique id has not been changed

* Move updating unique_id to __init__.py as suggested

* Change the config_entry variable's name back from config to config_entry

* Move the loop into the update_unique_ids method

* Move test from test_config_flow to test_init

* Try an early optimization to check if we need to update the unique ids

* Mention the correct version

* Implement suggestions

* Ensure all entities are migrated correctly

* Just to be sure keep the previous assertion as well
2024-05-30 18:27:15 +02:00
Tsvi Mostovicz ea91f7a5aa
Change strings to const in Jewish Calendar (#118274) 2024-05-28 07:49:39 +02:00
Tsvi Mostovicz 11646cab5f
Move Jewish calendar constants to const file (#118180)
* Move Jewish calendar constants to const file

* Add a few missed constants

* Move CONF_LANGUAGE to it's correct path
2024-05-26 19:23:02 +02:00
Yuval Aboulafia 2c09f72c33
Add config flow to Jewish Calendar (#84464)
* Initial commit

* add basic tests (will probably fail)

* Set basic UID for now

* Various improvements

* use new naming convention?

* bit by bit, still not working tho

* Add tz selection

* Remove failing tests

* update unique_id

* add the tests again

* revert to previous binary_sensor test

* remove translations

* apply suggestions

* remove const.py

* Address review

* revert changes

* Initial fixes for tests

* Initial commit

* add basic tests (will probably fail)

* Set basic UID for now

* Various improvements

* use new naming convention?

* bit by bit, still not working tho

* Add tz selection

* Remove failing tests

* update unique_id

* add the tests again

* revert to previous binary_sensor test

* remove translations

* apply suggestions

* remove const.py

* Address review

* revert changes

* Fix bad merges in rebase

* Get tests to run again

* Fixes due to fails in ruff/pylint

* Fix binary sensor tests

* Fix config flow tests

* Fix sensor tests

* Apply review

* Adjust candle lights

* Apply suggestion

* revert unrelated change

* Address some of the comments

* We should only allow a single jewish calendar config entry

* Make data schema easier to read

* Add test and confirm only single entry is allowed

* Move OPTIONS_SCHEMA to top of file

* Add options test

* Simplify import tests

* Test import end2end

* Use a single async_forward_entry_setups statement

* Revert schema updates for YAML schema

* Remove unneeded brackets

* Remove CONF_NAME from config_flow

* Assign hass.data[DOMAIN][config_entry.entry_id] to a local variable before creating the sensors

* Data doesn't have a name remove slugifying of it

* Test that the entry has been created correctly

* Simplify setup_entry

* Use suggested values helper and flatten location dictionary

* Remove the string for name exists as this error doesn't exist

* Remove name from config entry

* Remove _attr_has_entity_name - will be added in a subsequent PR

* Don't override entity id's - we'll fixup the naming later

* Make location optional - will by default revert to the user's home location

* Update homeassistant/components/jewish_calendar/strings.json

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* No need for local lat/long variable

* Return name attribute, will deal with it in another PR

* Revert unique_id changes, will deal with this in a subsequent PR

* Add time zone data description

* Don't break the YAML config until the user has removed it.

* Cleanup initial config flow test

---------

Co-authored-by: Tsvi Mostovicz <ttmost@gmail.com>
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-05-24 14:04:17 +02:00
J. Nick Koston 5a609c34bb
Fix blocking I/O in the event loop when loading timezones (#117721) 2024-05-20 11:06:03 +02:00
Marc Mueller aa16a9d707
Add empty line after module docstring (3) (#112750) 2024-03-08 20:38:34 +01:00
Marc Mueller c88b337600
Add empty line after module docstring [tests f-k] (#112709) 2024-03-08 14:50:04 +01:00
Jan-Philipp Benecke 92b3c0c96b
Update i-j* tests to use entity & device registry fixtures (#103900) 2023-11-13 11:51:55 +01:00
Franck Nijhof d3ed8de232
Update Ruff to v0.0.247 (#88210)
* Update Ruff to v0.0.247

* Fix new found violations
2023-02-15 16:46:03 -05: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 ea29cdfe83
Add type hints to integration tests (part 12) (#87997) 2023-02-13 13:03:51 +01:00
epenet f75ac17554
Add type hints to integration tests (j-m) (#87704) 2023-02-08 19:06:59 +01:00
Yuval Aboulafia 7c46eb5952
Add test for incorrect config for Jewish Calendar (#71163)
* Loop load Jewish Calendar platforms

* Address review

* Add test for incorrect config

* add test to sensor platform
2022-05-02 20:52:00 +03:00
J. Nick Koston fe6a4bfb1d
Remove EVENT_TIME_CHANGED and EVENT_TIMER_OUT_OF_SYNC (#69643)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-04-09 09:05:54 -10:00
Erik Montnemery cf4033b1bc
Simplify time zone setting in tests (#68330)
* Simplify timezone setting in tests

* Fix typo

* Adjust caldav tests

* Adjust input_datetime tests

* Adjust time_date tests

* Adjust tod tests

* Adjust helper tests

* Adjust recorder tests

* Adjust risco tests

* Adjust aemet tests

* Adjust flux tests

* Adjust forecast_solar tests

* Revert unnecessary change in forecast_solar test

* Adjust climacell tests

* Adjust google tests

* Adjust sensor tests

* Adjust sonarr tests

* Adjust template tests

* Adjust zodiac tests

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-03-20 10:25:15 +01:00
Simone Chemelli 969930b9c9
Remove debug print (#63460) 2022-01-05 15:34:33 +01:00
Franck Nijhof d4d791e0a1
Ensure Jewish Calendar returns an iso formatted timestamp (#52722) 2021-07-26 20:23:25 -07:00
J. Nick Koston bf2d40adfe
Migrate from pytz to python-dateutil (#49643)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2021-05-07 22:46:26 -07:00
amitfin f8690c29cd
Bump libhdate dependency (#48695) 2021-04-10 17:20:08 +02:00
amitfin 2391134d26
Update "issur_melacha_in_effect" via time tracking (#42485) 2021-04-09 12:26:55 +02:00
Erik Montnemery 84226da404
Update tests i-o to use async_get() instead of async_get_registry() (#47653) 2021-03-09 14:32:08 +01:00
Franck Nijhof 65cf2fcb6f
Drop asynctest (#44746) 2021-01-01 22:31:56 +01:00
Andrew Marks d0af3339fc
Add unique_id to jewish_calendar entities (#39025) 2020-09-06 20:29:17 -05:00
J. Nick Koston 89a9634d35
Use eventloop for scheduling (#37184)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-06-29 09:39:24 -07:00
Paulus Schoutsen 2af984917e
Use asynctest-mock in most places (#35109)
* Use asynctest-mock in most places

* Fix broken patch in pilight
2020-05-03 11:27:19 -07:00
Moshe Kaplan 7dff5e79d1
Add support for displaying Daf Yomi (#30628)
* Add support for displaying Daf Yomi

* Ran black --fast

* Added docstring to get_daf

* Further lint fixes

* Remove unnecessary else

* clarify code

* Use fstrings

* pull daf yomi from hdate

* Update manifest version for daf_yomi support

* fix variable usage

* Update requirements

* Also pass in today's date as well

* Rename date variable to daytime_date

* Add tests for daf yomi sensor

* Update stale test IDs
2020-02-16 00:00:17 +01:00
Franck Nijhof f5d4878992 Fix isort on a small set of misc files (#29803) 2019-12-10 09:25:42 +01:00
Bas Nijholt 0fbb450838 Sort imports according to PEP8 for jewish_calendar (#29697)
* use isort to sort imports according to PEP8 for jewish_calendar

* fix order
somehow isort did the wrong thing
2019-12-09 11:30:31 +01:00
Tsvi Mostovicz d7a66e6e4c Return Jewish Calendar holiday type id support (#29168)
* Bring back holiday type id as a attribute to the holiday sensor

* Add test for holiday type id attribute
2019-11-27 20:52:03 +01:00
Tsvi Mostovicz 2bc6b59e79 Move holiday info into a single sensor with multiple attributess (#27654)
* Move holiday onfo into a single sensor with multiple attributess

* Add tests for holiday attributes
2019-10-17 20:32:24 -07:00
Tsvi Mostovicz 9e3005133a Standardize times in time sensors Jewish calendar (#26940)
* Standardize times in time sensors Jewish calendar

* Fix pylint errors

* Add non-default time format test

* Make black happy

* Remove timestamp device class

Timestamp device class requires ISO 8601 format

* Revert "Remove timestamp device class"

This reverts commit 8a2fda39831bc750c3a77aa774b84b054d78032c.

* Remove time_format

As this is part of the UI decision, it should be decided by lovelace.

A nice addition for a future PR, might be the option to hint to lovelace the preferred way to display some data.

* Update name of state_attributes

* State of timestamp variable to be shown in UTC

Although I don't understand it, I give up :)

* Remove unnecessary attributes

I don't really see the value in these attributes, if there are any they should be implemented in
the sensor component for the timestamp device class
2019-10-10 20:57:48 +02:00
Tsvi Mostovicz 815e7a70e9 Jewish calendar binary sensor (#26200)
* Move jewish calendar to its own platform

* Fix tests for Jewish Calendar platform

As part of this, move tests to use async_setup_component instead of
testing JewishCalendarSensor as suggested by @MartinHjelmare here:

https://github.com/home-assistant/home-assistant/pull/24958#pullrequestreview-259394226

* Get sensors to update during test

* Use hass.config.set_time_zone instead of directly calling set_default_time_zone in tests

* Cleanup log messages

* Rename result from weekly_portion to parshat_hashavua

* Fix english/hebrew tests

* Fix updating of issue melacha binary sensor

* Fix docstrings of binary sensor

* Reset timezones before and after each test

* Use correct entity_id for day of the omer tests

* Fix omer tests

* Cleanup and rearrange tests

* Remove the old issur_melacha_in_effect sensor

* Rename variables to make the code clearer

Instead of using lagging_date, use after_tzais and after_shkia

* Use dt_util.set_default_time_zone instead of hass.config.set_time_zone so as not to break other tests

* Remove should_poll set to false (accidental copy/paste)

* Remove _LOGGER messaging during init and impossible cases

* Move binary tests to standalone test functions

Move sensor tests to standalone test functions

* Collect entities before calling add_entities

* Fix pylint errors

* Simplify logic in binary sensor until a future a PR adds more sensors

* Rename test_id holyness to holiday_type

* Fix time zone for binary sensor tests

Fix time zone for sensor tests

* Don't use unnecessary alter_time in sensors

Don't use unnecessary alter time in binary sensor

Remove unused alter_time

* Simply set hass.config.time_zone instead of murking around with global values

* Use async_fire_time_changed instead of directly calling async_update_entity

* Removing debug messaging during init of integration

* Capitalize constants

* Collect all Entities before calling async_add_entities

* Revert "Don't use unnecessary alter_time in sensors"

This reverts commit 74371740eaeb6e73c1a374725b05207071648ee1.

* Use test time instead of utc_now

* Remove superfluous testing

* Fix triggering of time changed

* Fix failing tests due to side-effects

* Use dt_util.as_utc instead of reimplementing it's functionality

* Use dict[key] for default values

* Move 3rd party imports to the top of the module

* Fix imports
2019-09-06 13:24:10 +02:00
Paulus Schoutsen 4de97abc3a Black 2019-07-31 12:25:30 -07:00