HA webhook works, also more makelaars
This commit is contained in:
@@ -10,13 +10,13 @@ from adapters import SCRAPERS
|
||||
|
||||
logging.basicConfig(
|
||||
stream=sys.stdout,
|
||||
level=logging.DEBUG,
|
||||
level=logging.INFO, # debug costs too many tokens
|
||||
format="%(asctime)s %(levelname)s %(name)s — %(message)s",
|
||||
datefmt="%Y-%m-%dT%H:%M:%S",
|
||||
)
|
||||
|
||||
# --- change this to test a different adapter ---
|
||||
ADAPTER = SCRAPERS['3dmakelaars']
|
||||
ADAPTER = SCRAPERS['dupont']
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Testing adapter: {ADAPTER.__name__}")
|
||||
|
||||
@@ -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)")
|
||||
|
||||
Reference in New Issue
Block a user