Skip to content

Commit 3392035

Browse files
authored
Feature/improve package install (#203)
* need to work with strings, not posixpath * try to slim down and improve requirements/deps process * separate app dir and project dir * set log level in __main__ * improve docker docs * replace em dashes with dashes * additional docs cleanup * remove value converters doc, will re-add when i have time to make a good one that i trust * update changelog, fix links to not use ./
1 parent 30f6c6f commit 3392035

33 files changed

+1532
-1144
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## Unreleased
99

10+
## [0.18.1] - 2025-12-13
11+
12+
### Changed
13+
- Improve docker startup script and dependency handling
14+
- Rewrite docker docs to be more clear about project structure and dependency installation
15+
16+
### Fixed
17+
- Fixed a bug in autodetect apps exclusion directories
18+
- Previous commit had mapped the exclusion dirs to Path objects, which broke the set comparison, this has been reverted
19+
1020
## [0.18.0.dev3] - 2025-12-13
1121

1222
### Changed

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ RUN apt-get update \
3535
curl \
3636
tini \
3737
tzdata \
38+
fd-find \
3839
&& rm -rf /var/lib/apt/lists/*
3940

4041
WORKDIR /app

docs/_static/style.css

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,36 @@
55

66
/* Match link-in-code color to normal code-literal red */
77
.rst-content a.reference code.literal {
8-
color: #e74c3c !important; /* tweak to taste */
9-
text-decoration: underline; /* optional — helps signal it's clickable */
8+
color: #e74c3c !important;
9+
/* tweak to taste */
10+
text-decoration: underline;
11+
/* optional - helps signal it's clickable */
1012
}
1113

1214
/* Optional hover state: slightly darker red for clarity */
1315
.rst-content a.reference:hover code.literal {
14-
color: #a60000 !important; /* tweak to taste */
16+
color: #a60000 !important;
17+
/* tweak to taste */
1518
}
1619

1720

1821
/* Center it, make it responsive, trim vertical whitespace */
1922
.rst-content img.hero {
20-
display: block; /* make margin auto work */
21-
margin: 2rem auto 2rem !important; /* top/bottom tighter, centered */
22-
padding: 0 !important;
23-
max-width: 420px; /* cap huge screens */
24-
height: auto;
25-
filter: drop-shadow(0 20px 20px rgba(0, 0, 0, 0.15));
23+
display: block;
24+
/* make margin auto work */
25+
margin: 2rem auto 2rem !important;
26+
/* top/bottom tighter, centered */
27+
padding: 0 !important;
28+
max-width: 420px;
29+
/* cap huge screens */
30+
height: auto;
31+
filter: drop-shadow(0 20px 20px rgba(0, 0, 0, 0.15));
2632

2733
}
2834

2935
/* On very small screens, widen a bit */
3036
@media (max-width: 480px) {
31-
.rst-content img.hero { width: 80%; }
37+
.rst-content img.hero {
38+
width: 80%;
39+
}
3240
}

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Get running with Hassette in just a few steps.
4747
Ready to build something more complex? Explore the rest of the docs:
4848

4949
- Follow the [getting started guide](pages/getting-started/index.md) for local development.
50-
- Deploy with [Docker Compose](pages/getting-started/docker.md) for production.
50+
- Deploy with [Docker Compose](pages/getting-started/docker/index.md) for production.
5151
- Dive into [core app patterns](pages/core-concepts/apps/index.md).
5252
- See how Hassette stacks up in the [AppDaemon comparison](pages/appdaemon-comparison.md).
5353
- Dive into the [advanced concepts](pages/advanced/index.md).

docs/pages/advanced/dependency-injection.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,6 @@ The TypeRegistry provides comprehensive built-in conversions for common types:
361361
- **Numeric types**: `str``int`, `float`, `Decimal`
362362
- **Boolean**: `str``bool` (handles `"on"`, `"off"`, `"true"`, `"false"`, etc.)
363363
- **DateTime types**: `str``datetime`, `date`, `time` (stdlib), and `whenever` types
364-
- **And more**: See [Value Converters Reference](value-converters.md)
365364

366365
**Examples:**
367366
```python
@@ -518,6 +517,5 @@ The core implementation lives in:
518517

519518
## See Also
520519

521-
- [Type Registry](type-registry.md) — automatic type conversion system
522-
- [Value Converters](value-converters.md) — complete list of built-in type conversions
523-
- [State Registry](state-registry.md) — domain to state model mapping
520+
- [Type Registry](type-registry.md) - automatic type conversion system
521+
- [State Registry](state-registry.md) - domain to state model mapping

docs/pages/advanced/index.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ Hassette does a lot under the hood to make building Home Assistant automations e
44

55
These features are:
66

7-
- Dependency injection
8-
- Custom states
9-
- The State Registry
10-
- The Type Registry
7+
- [Dependency injection](dependency-injection.md)
8+
- [Custom states](custom-states.md)
9+
- [The State Registry](state-registry.md)
10+
- [The Type Registry](type-registry.md)
1111

1212
## Dependency Injection
1313

@@ -19,7 +19,7 @@ For example, `StateNew` is a built-in provider that extracts the new state from
1919

2020
This is as simple as using the [`Annotated`][typing.Annotated] type hint to specify a type and an extractor. Hassette does have an [accessor][hassette.event_handling.accessors] module that has built-in extractors, so for this example you could use `get_state_attr_new`. Combining these tools allows you to create powerful, reusable DI providers for your specific needs.
2121

22-
Read more in the [Dependency Injection guide][pages/advanced/dependency-injection.md].
22+
Read more in the [Dependency Injection guide](dependency-injection.md).
2323

2424
## Custom States
2525

@@ -30,7 +30,7 @@ Home Assistant has many built in states, but many many more states that come fro
3030
Custom states can be defined as simply as creating a new State class from [`BaseState`][hassette.models.states.base.BaseState] or one if it's subclasses. `BaseState`
3131
uses `__init_subclass__` to automatically register the class with the [State Registry][hassette.core.state_registry.StateRegistry] based on its `domain` attribute. This means that once you have defined the class, it will be used automatically whenever a state with the matching domain is encountered in your automations.
3232

33-
There is a dedicated [Custom States guide][pages/advanced/custom-states.md] that goes into more detail on how to define and use custom states in your Hassette apps.
33+
There is a dedicated [Custom States guide](custom-states.md) that goes into more detail on how to define and use custom states in your Hassette apps.
3434

3535
## Registries
3636

@@ -42,7 +42,7 @@ The State Registry contains a map of state domain names to their corresponding S
4242

4343
The State Registry generally does not need to be interacted with directly, as the `__init_subclass__` hook automatically registers new State classes when they are defined.
4444

45-
You can read more about the State Registry in the [State Registry guide][pages/advanced/state-registry.md].
45+
You can read more about the State Registry in the [State Registry guide](state-registry.md).
4646

4747
### Type Registry
4848

@@ -51,4 +51,4 @@ The Type Registry contains a map of custom types to their corresponding type con
5151
The `TypeRegistry` allows for manually registering new type converters, giving you full control over how custom types are handled in your automations. You can also
5252
access the registry directly if needed, which can allow you to convert between types without having to rewrite your type conversion logic.
5353

54-
You can read more about the Type Registry in the [Type Registry guide][pages/advanced/type-registry.md].
54+
You can read more about the Type Registry in the [Type Registry guide](type-registry.md).

docs/pages/advanced/state-registry.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,6 @@ state = convert_state_dict_to_model(
374374

375375
## See Also
376376

377-
- [Type Registry](type-registry.md) — automatic value type conversion
378-
- [Dependency Injection](dependency-injection.md) — using StateRegistry via DI annotations
379-
- [Custom States](custom-states.md) — defining your own state classes
380-
- [Value Converters](value-converters.md) — complete list of built-in type conversions
377+
- [Type Registry](type-registry.md) - automatic value type conversion
378+
- [Dependency Injection](dependency-injection.md) - using StateRegistry via DI annotations
379+
- [Custom States](custom-states.md) - defining your own state classes

docs/pages/advanced/type-registry.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,4 +529,3 @@ def str_with_units_to_float(value: str) -> float:
529529
- [State Registry](state-registry.md) - Domain to model class mapping
530530
- [Dependency Injection](dependency-injection.md) - Using TypeRegistry with custom extractors
531531
- [State Models](../core-concepts/states/index.md) - State model reference
532-
- [Value Converters](value-converters.md) - Complete list of built-in converters

0 commit comments

Comments
 (0)