Deploy 0.18.0 to master #193

Merged
admin merged 30 commits from deploy-0.18.0 into master 2026-10-16 00:42:55 +02:00
2 changed files with 15 additions and 7 deletions
Showing only changes of commit 4eb88f7fda - Show all commits
+7 -4
View File
@@ -2320,11 +2320,14 @@ Do this on the Configuration tab, in one save, and restart once:
3. **Clear** **Current price entity** (`price_now_entity`) and **Average price 3. **Clear** **Current price entity** (`price_now_entity`) and **Average price
entity** (`price_avg_entity`). The add-on refuses to start with a price entity** (`price_avg_entity`). The add-on refuses to start with a price
source and these two together. source and these two together.
4. Keep **Supplier markup** and **Distribution, levies and VAT** as they are 4. Check **Supplier markup** and **Distribution, levies and VAT**. With the
for a wholesale price. If the Home Assistant sensors already included them, Home Assistant pair they decided nothing about the maintenance charge. With
the figures were never in these two options, so nothing else changes. the provider they are added to the wholesale price, so they set the prices
shown on the page and, if battery modes or trading are on, the prices those
decide on. The maintenance charge gate does not depend on them.
5. Keep **Fixed or day/night tariff** (`static_profile`) if you have one. It 5. Keep **Fixed or day/night tariff** (`static_profile`) if you have one. It
stays the fallback for trading when no source answers. is still the tariff used, marked as estimated and without trading, while no
source has a price.
6. Remove the `price_service` REST and template sensors from Home Assistant 6. Remove the `price_service` REST and template sensors from Home Assistant
when you are satisfied. They are no longer read. when you are satisfied. They are no longer read.
+8 -3
View File
@@ -21,7 +21,7 @@ THE SERVER IS A MOCK. This session holds no token, so it cannot ask the real
one for a price. `Server` below answers the layout the design's API section one for a price. `Server` below answers the layout the design's API section
gives (`unix_seconds`, `price`, `unit`, `zone`, `covers`, `source`, gives (`unix_seconds`, `price`, `unit`, `zone`, `covers`, `source`,
`fetched_at`), over a transport with the same contract as `price.https_get`. `fetched_at`), over a transport with the same contract as `price.https_get`.
Section 12 drives the REAL `https_get` against a local aiohttp server, for the Section 11 drives the REAL `https_get` against a local aiohttp server, for the
parts a mock transport cannot show: the header on the wire, the status words, parts a mock transport cannot show: the header on the wire, the status words,
the timeout, a refused connection. the timeout, a refused connection.
@@ -637,6 +637,9 @@ class FakeHass:
async def number(self, entity, invert=False): async def number(self, entity, invert=False):
return self.values.get(entity) return self.values.get(entity)
async def set_number(self, entity, value):
return True
async def call(self, domain, service, data): async def call(self, domain, service, data):
self.calls.append((domain, service, data)) self.calls.append((domain, service, data))
return True return True
@@ -730,11 +733,13 @@ class Wired:
await asyncio.wait_for(task, timeout=5) await asyncio.wait_for(task, timeout=5)
async def tick(self, now=None): async def tick(self, now=None):
"""One 30 s tick: read inputs, then the price-gap check.""" """One control tick as `run_control` makes it: read inputs, then the
cycle, which is where the price-gap check is called from."""
if now is not None: if now is not None:
self.clock.now = now self.clock.now = now
self.ctl.auto = True
await self.ctl.read_inputs() await self.ctl.read_inputs()
await self.ctl.check_price_gap() await self.ctl.cycle()
def notes(self): def notes(self):
return [(s, d) for dom, s, d in self.ctl.hass.calls return [(s, d) for dom, s, d in self.ctl.hass.calls