Home Assistant Unofficial Reference 2024.12.1
helpers.py
Go to the documentation of this file.
1 """Helpers for the CloudFlare integration."""
2 
3 import pycfdns
4 
5 
6 def get_zone_id(target_zone_name: str, zones: list[pycfdns.ZoneModel]) -> str | None:
7  """Get the zone ID for the target zone name."""
8  for zone in zones:
9  if zone["name"] == target_zone_name:
10  return zone["id"]
11  return None
str|None get_zone_id(str target_zone_name, list[pycfdns.ZoneModel] zones)
Definition: helpers.py:6