def test_is_ha_addon(monkeypatch, value, expected): if value is None: monkeypatch.delenv("ESPHOME_IS_HA_ADDON", raising=False) else: monkeypatch.setenv("ESPHOME_IS_HA_ADDON", value) actual = helpers.is_ha_addon() assert actual == expected
def relative_piolibdeps_path(self, *path): if is_ha_addon(): return os.path.join("/data", self.name, ".piolibdeps", *path) return self.relative_build_path(".piolibdeps", *path)