HA webhook works, also more makelaars

This commit is contained in:
2026-04-04 01:35:29 +02:00
parent b35025b9cb
commit 8450c33887
4 changed files with 163 additions and 3 deletions

View File

@@ -0,0 +1,37 @@
import sys
sys.path.insert(0, "../src")
import logging
from huizenbot import notify_ha, RawListing
logging.basicConfig(
stream=sys.stdout,
level=logging.INFO, # debug costs too many tokens
format="%(asctime)s %(levelname)s %(name)s%(message)s",
datefmt="%Y-%m-%dT%H:%M:%S",
)
TEST_LISTING = RawListing(
url="https://home.kalsbeek.dev/api/webhook/new_house",
source_makelaar="test",
adres="Teststraat 1",
stad="Delft",
postcode="2613AA",
prijs=350000,
hero_image_url=None,
)
TEST_TRAVEL = {
"fiets_persoon1": 20,
"fiets_persoon2": 35,
"ov_persoon1": 30,
"ov_persoon2": 45,
}
if __name__ == "__main__":
print("=== Home Assistant webhook ===")
notify_ha(TEST_LISTING, TEST_TRAVEL)
print(" verstuurd (check HA voor bevestiging)")