Repository navigation
Audit fixes: correct calendar values, leaner core, tests against known answers - #4
Merged
Merged
Conversation
…answer tests Fixes all 20 findings of the repo audit plus three small ones. Wrong values / crashes - swatch: BMT is fixed UTC+1, no daylight saving (was one hour off all summer) - stardate, discworld, eve, islamic, rivendell, shire, tamriel: options are now actually loaded (set_options() was never called) - warcraft: IndexError on 52 days a year (moon phase index) - julian: Julian Date was half a day too low - mars: Mars Sol Date 4.4 sols too high, Ls guessed linearly, landing sols - darian: year 85 instead of 221 (ratio, epoch, month lengths, leap years) - solar_system: real geocentric geometry, visibility by elongation, retrograde computed; map no longer stored three times in the attributes - islamic weekday, Thai zodiac, lunar illumination (one-line slips) - hindu_panchang, japanese_lunar, suriyakati, sexagesimal: real new/full moons and Sun/Moon longitude instead of made-up cycles - stellar_distances: errors reach the base class instead of the state - timezone: unknown zone name raised NameError while the entity was added - 25 calendars used the OS clock; they now use Home Assistant's time zone Core - one calendar discovery instead of three, no sys.path changes - one option-form builder for wizard and options dialog - new sensors get entity_id sensor.alternative_time_<calendar> explicitly - wizard and sensors pick the language the same way (i18n.py); translations/zh.json renamed to zh-Hans.json - astro.py: shared, dependency-free astronomy (Julian day, Meeus moon phases, Sun/Moon longitude, lunisolar calendar, Mars Sol Date and Ls) - dead code removed (unused constants, async_setup/CONFIG_SCHEMA, hass.data bookkeeping, pass-through async_update, dead options) - pytz and tzlocal dropped; zoneinfo instead Housekeeping - removed calendars/test_debug.py, template.py.example, calendars/README.md, README_FIX.md; LICENCE renamed to LICENSE - README: 45 calendars, two non-existent calendars removed - CI lints tests/; tests: 80 -> 175, incl. published reference values Removed attributes/options (see CHANGELOG): solar_system_map_svg, solar_system_map_png, observer_location, darian.month_names, german_rescue_dtg.show_timezone. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…tant ships itself The PIL import in solar_system.py is optional and Home Assistant core already depends on Pillow, so the PNG map keeps working. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes all 20 findings of the full repo audit, plus three small ones. This changes displayed values, removes three attributes and two options — please test in a live instance before it is tagged. No version bump yet; the notes sit under
[Unreleased]inCHANGELOG.md(planned: 2.7.0).Wrong values and crashes
swatchEurope/Zurichwith daylight saving.stardate,discworld,eve,islamic,rivendell,shire,tamrielset_options()was defined but never called.warcraftIndexErroron 52 days a year.julian_datemarsdariansolar_systemFalse.islamic,suriyakati,lunar_timehindu_panchang,japanese_lunar,suriyakati,sexagesimalstellar_distancestimezoneNameErrorwhile the entity was added.TZ) instead of Home Assistant's time zone.Core
sys.pathchanges; a plugin that fails to import is logged at ERROR.entity_id = sensor.alternative_time_<calendar>set explicitly. Newer Home Assistant versions prefixed device and area names onto the suggested id, so the recorder glob from the README could miss them. Existing entities keep their id.i18n.py).translations/zh.jsonis nowzh-Hans.json.astro.py: shared, dependency-free astronomy (Julian day, Meeus moon phases, Sun/Moon longitude, lunisolar calendar, Mars Sol Date and Ls).pytzandtzlocaldropped in favour ofzoneinfo. Requirements are nowLunarCalendarandPillowonly.calendars/test_debug.py,template.py.example,calendars/README.md,README_FIX.md.LICENCErenamed toLICENSE.Breaking for users
solar_system: attributessolar_system_map_svg,solar_system_map_pngandobserver_locationare gone. Uselocal_svg_path,local_png_pathorentity_picture.darian.month_namesandgerman_rescue_dtg.show_timezoneare gone (they had no effect).Tests
pytest tests: 175 passed (was 80),ruffclean oncustom_components/andtests/. New:Not verified
chinese_lunarneeds a library that is not installed on the dev machine.🤖 Generated with Claude Code