Commit Graph
54 Commits
Author SHA1 Message Date
DigiLive 22f523d0ee Optimize Home View
Changed code to be compatible with changed imports.
Also, the code is optimized and more concise.
2025-05-13 12:08:39 +02:00
DigiLive c1754ce598 Optimize Views
- Make use of the debug module.
- Make use of the auxiliaries module.
- Make use of the localization module.
- Make use of the Registry module.
- Align code across the chip modules.
- Make configurations immutable.
- Make use of the refactored types.
2025-05-13 12:08:39 +02:00
DigiLive 5b02f20084 Optimize Cards
- Make use of the debug module.
- Make use of the Registry module.
- Align code across the chip modules.
- Make configurations immutable.
- Make use of the refactored types.
2025-05-13 12:08:36 +02:00
DigiLive db3a00d6f2 Optimize Chips
- Make use of the debug module.
- Make use of the Registry module.
- Align code across the chip modules.
- Make configurations immutable.
- Make use of the refactored types.
2025-05-13 12:08:30 +02:00
DigiLive 3c8a236961 Fix translation files
- Align the translation keys across the files.
- Fix typos.
2025-05-13 12:08:19 +02:00
DigiLive 3725b89f9e Add Registry class.
The class is an optimized version of the Helper class.

- Sanitization of the HASS registries after import according to the
  configuration options.
- Improved error handling and logging.
- Removed generic utility functions.
2025-05-13 12:08:13 +02:00
DigiLive d224fc353c Refactor ConfigurationDefaults
Making use of the global localization functions, ConfigurationDefaults
is now a constant value instead of a function.
2025-05-13 12:08:10 +02:00
DigiLive e94ce9c830 Refactor Controller Card
The card is renamed to Header Card because it's clearer regarding its
purpose.
2025-05-13 12:08:08 +02:00
DigiLive 500a221638 Add modules
- debug module for centralized logging and debug level management.
- localize module for localization functions in the global scope.
- RegistryFilter module for advanced filtering and sorting of HASS
  registries.
- auxiliaries module for genric utility functions.
2025-05-13 12:08:03 +02:00
DigiLive b068486aeb Refactor types and interfaces.
- Update third party types and interfaces to their latest versions.
- Strategy types and interface removed from namespace and split into
  separate files.
- Update Strategy types, interfaces and typeguards to be more
  restrictive and concise.
- Add missing docblocks.
2025-05-13 12:07:57 +02:00
DigiLive 3b30cd951b Bump Strategy version 2025-05-13 12:07:37 +02:00
DigiLive a852347cc4 Fix typo in JSDOC 2025-05-13 12:07:34 +02:00
DigiLive b3ca5f94f9 Optimize types
The type definitions and interfaces of Home Assistant and Mushroom where
outdated. Also, the type definitions and interfaces of the strategy
could use some refinement.
2025-05-13 12:07:05 +02:00
Ferry Cools a5ec18823d Release v2.3.0 (#195)
Adds:

- Strategy:
  - SceneCard: Support for Stateful scenes. Closes #190.
  - ValveCard: A card to control an entity of the valve domain. Closes #192.
  - LockView: A view for entities of the lock domain. Closes #171.
- Modules:
  - RegistryFilter: Advanced filtering and sorting of Home Assistant registries.
  - Auxiliaries: Generic utility functions.
  - Debug: Centralized logging and debug level management.
- Tooling:
  - ESLint configuration for linting.
  - Prettier configuration for code formatting.


Removes:

- Redundant types and interface annotations.
- Redundant legacy and unused modules.
- Localization constant from the `Helper` module in favor of a new `localize` utility.

Refactors:

- References regarding change of repository owner.
- Auxiliary functions are moved from the `Helper` module to `Auxiliaries` module.
- `Helper` module is renamed to `Registry` for centralized state and registry management.
- `ControllerCard` is renamed to `HeaderCard`.
- Doc-blocks and comments are updated for clarity and consistency.
- The file tree is restructured for improved clarity, modularity, and scalability.
- Third party type definitions are updated and cleaned up.
- Issue and Pull Request templates.

Optimizations:

- Parallelization of dynamic imports for views and cards.
- Improved error handling and logging throughout the codebase.
- Sanitization of HASS registries after import.
- Enforced stricter and simplified types and interfaces.
- Localization now available at global scope.

Fixes:

- Wrong type in configuration of `HeaderCard`.
- Translation files: Resolved key inconsistencies.
- Removed unnecessary namespaces from types.
- Typos and Grammar.
- Explicit use of `any` types.
- Turn off all entities of a domain with a chip tap action.
- Rendering too small HASS area cards.
- Count of active vacuums.


Bumps:

- Mushroom Strategy
- home-assistant-js-websocket
- superstruct
- ts-loader
- ts-node
- typescript
- webpack
- webpack-cli
2025-05-13 07:01:26 +02:00
w531t4 711140d13f Add hiding diagnostic entities (#153)
Config and diagnostic entities are now hidden by default.

Their visibility can be defined in the configuration with entries
`hide_config_entities` and `hide_diagnostic_entities` for all or individual domains.
2025-03-23 07:33:00 +01:00
Marcoske23andFerry Cools bee8f4b236 Add Spanish translation (#179)
Co-authored-by: Ferry Cools <fcools@digilive.nl>
2025-03-08 08:29:07 +01:00
Marc d91c8e3159 Add German translation (#176) 2025-03-08 08:26:12 +01:00
w531t4andDigiLive d1456426de Add scene domain and associated tap-action (#164)
Scenes are added as a domain so they're available at the top navigation 
bar.
The view doesn't have controller cards since switching multiple scenes 
at once makes no sense.

---------

Co-authored-by: DigiLive <github@digilive.nl>
2025-03-08 08:25:17 +01:00
Marc 7f4a6bce89 Fix faulty translation key for covers 2025-02-09 06:52:26 +01:00
w531t4 da7d0cd57c Fix counting of hidden entities and devices
Evaluation an entity's hidden property in the strategy options, is now
included in Helper.#areaFilterCallback().
2025-02-09 06:48:38 +01:00
Ferry Cools ebfd034e20 Fix counting entity states
* Add state filters to getCountTemplate()  
States `unavailable` and `unknown` are now excluded from the return
value of `getCountTemplate()`, since there's no interest in counting
those states. This change affect all entities.

* Add states to unclosed cover count  
Aside from state `open`, the cover-chip and -view, will include state 
`opening` and `closing` to the count of unclosed covers.
2024-12-13 07:29:15 +01:00
Ferry Cools 2cd4512b4f Add localization
Fixed dashboard strings are replaced with a string in the language as
defined by the user.
Currently, languages `en` and `nl` are supported.
If the user-defined language isn't supported, the language will fall
back to english.
Untranslated strings will fall back to the translation keyword.

Resolves #166
2024-12-13 06:56:23 +01:00
w531t4andDigiLive e927ae6ba5 Add auto import of area icons in home view (#158)
* Changed the default icon for an area.
* Add auto import of area icons in home view (Closes #147).
  The default icon is overwritten at the constructor, if a user-defined icon is set in hass.

---------

Co-authored-by: DigiLive <github@digilive.nl>
2024-11-29 09:27:47 +01:00
w531t4 6f444c5c15 Fix entity card added twice to view (#154)
If not using the area of the entity's device, a card for this entity is 
added for the custom set area, as well as for the area of the entity's 
device.

This change keeps the entity for the custom-set area or else for the 
area of the entity's device.
2024-11-22 11:50:19 +01:00
Aalian Khan d037c31001 bump to 2.2.0 2024-11-18 21:01:43 -05:00
Wallerand Delevacq dbebfc88d3 Support Select/InputSelect mushroom cards (#151)
Add cards

* Select Card.
* Input Select Card

Contribution by wallforfry
2024-10-19 12:27:42 +02:00
Subhash ChandraandDigiLive fba9364106 Add option to hide config-entities (#103).
* Introduces a `hide_config_entities` strategy-option to define if a 
  config-entity should be hidden or not.

* Bumps version number to 2.1.0

---------

Co-authored-by: DigiLive <github@digilive.nl>
2024-02-01 06:57:39 +01:00
Ferry Cools ae744bf177 Fix package version (#124)
The version number has been updated from 2.0.0/2.0.2 to 2.0.3 across
multiple files.
2024-01-28 17:11:26 -08:00
NiekertandFerry Cools e174d06957 Fix views not loading when using card_options (#118)
The logic to check whether an entity is hidden has been changed.

Instead of checking the `entity_id` field which is always undefined, the
updated logic now dynamically references the `entity.entity_id` within 
the card options of the strategy options.

---------

Co-authored-by: Ferry Cools <fcools@digilive.nl>
2024-01-26 12:41:17 +01:00
Ferry Cools 82a91c3bd4 Refactor JavaScript to TypeScript (#81)
Other changes include:

* Add Vacuum Card and View.

* Add hiding a view if no device is configured for it. Closes #24.

* Add icon to HomeView configuration.

* Add version output to console.

* Add version bumper.

* Add .editorconfig settings.

* Refactor README, because the information moved to the repository's
   Wiki. Closes #87.
2023-11-22 21:02:56 +01:00
Julian Schill bf69335a4e Add color temperature button to light card (#93) 2023-11-15 20:34:36 +01:00
Johan Frick f76a596572 Add Mushroom Number Card (#79)
A Mushroom Number Card for number and input_number entities.
2023-10-31 14:41:37 +01:00
Ferry CoolsandJohan Frick d8274b1272 Add possibility to hide home elements
Elements of the home view can be hidden by listing them at the strategy
options:

```YAML
strategy:
  type: custom:mushroom-strategy
  options:
    homeView:
      hidden:
        - Greeting
        - AreaTitle
views: []
```
---------

Co-authored-by: Johan Frick <johan.frick@gmail.com>
2023-10-23 11:51:02 +02:00
Johan FrickandDigiLive 98ef9fed05 Add options for all areas (#52)
Area identifier `_` sets the options for all areas.
Options for a specific area can still be overridden like before.

Also the HA area-card is added to use as a strategy area-card.

---------

Co-authored-by: DigiLive <info@digilive.nl>
2023-10-13 08:12:11 +02:00
Aalian Khan 8f4fce7d54 Fix Home view not loading because of lack of weather entity 2023-09-25 22:04:57 -04:00
DigiLive 629dfa610d Fix 2 Title cards in pre-built views
Closes #56
2023-09-19 18:36:43 +02:00
Aalian Khan 3bbbdad035 Merge branch 'main' of https://github.com/AalianKhan/mushroom-strategy into hide-devices 2023-09-19 11:03:45 -04:00
Aalian Khan 3063776a5f Refactor grouped cards 2023-09-19 10:47:35 -04:00
Aalian Khan 7ab85afb85 Refactor to look at card_options instead 2023-09-14 15:58:59 -04:00
Aalian Khan 01c6205c02 Add option to hide all entities of a device.
#48
2023-09-14 15:40:37 -04:00
Aalian Khan 14f514fffe Fix area title position
put the area title card inside the vertical stack so everything matches up in the desktop view.
2023-09-13 19:20:41 -04:00
Aalian Khan 0d3b0a9089 Refactor bug fix 2023-09-11 11:33:46 -04:00
Aalian Khan 178a2fe003 Fix hiding default domain
this solution works, but it uses another variable. If you have a better idea, please feel free to share
2023-09-09 19:05:59 -04:00
Aalian Khan 703bd20bf2 Fix typdef.js for LockCardOptions 2023-09-07 16:39:46 -04:00
Aalian Khan df0f2b5568 Add LockCardOptions to typedef.js 2023-09-06 16:22:02 -04:00
Aalian Khan aad52cdadb Mark bug 2023-09-05 19:17:34 -04:00
Aalian Khan 1025201e2b Fix lock icon by adding lock domain
Fixes #41
2023-09-05 18:57:19 -04:00
Ferry Cools a6b2499a7b Merge branch 'main' into camera-fix 2023-08-15 15:28:27 +02:00
Aalian Khan e2889add02 Fix camera cards to use picture entity 2023-08-14 14:56:03 -04:00
Ferry Cools 140aec854b Add options to configure entity-cards (#31)
* Add options to configure entity-cards

Closes #10.
- Option to set the type of entity card.
- Option to hide an entity card from the dashboard.

* Add hiding title cards

When all entity cards are hidden for an area or domain, the
corresponding title cards will be hidden also.

* Fix Climate Chip navigation

Closes #33

* Build production distribution
2023-07-19 15:07:55 +02:00