Exemple #1
0
async def _mock_powerwall_with_fixtures(hass):
    """Mock data used to build powerwall state."""
    meters = await _async_load_json_fixture(hass, "meters.json")
    sitemaster = await _async_load_json_fixture(hass, "sitemaster.json")
    site_info = await _async_load_json_fixture(hass, "site_info.json")
    status = await _async_load_json_fixture(hass, "status.json")
    device_type = await _async_load_json_fixture(hass, "device_type.json")

    return _mock_powerwall_return_value(
        site_info=SiteInfoResponse(site_info),
        charge=47,
        sitemaster=SitemasterResponse(sitemaster),
        meters=MetersAggregateResponse(meters),
        grid_status=GridStatus.CONNECTED,
        status=PowerwallStatusResponse(status),
        device_type=DeviceType(device_type["device_type"]),
    )
Exemple #2
0
async def _mock_powerwall_with_fixtures(hass):
    """Mock data used to build powerwall state."""
    meters = await _async_load_json_fixture(hass, "meters.json")
    sitemaster = await _async_load_json_fixture(hass, "sitemaster.json")
    site_info = await _async_load_json_fixture(hass, "site_info.json")
    status = await _async_load_json_fixture(hass, "status.json")
    device_type = await _async_load_json_fixture(hass, "device_type.json")

    return _mock_powerwall_return_value(
        site_info=SiteInfo(site_info),
        charge=47.34587394586,
        sitemaster=SiteMaster(sitemaster),
        meters=MetersAggregates(meters),
        grid_status=GridStatus.CONNECTED,
        status=PowerwallStatus(status),
        device_type=DeviceType(device_type["device_type"]),
        serial_numbers=["TG0123456789AB", "TG9876543210BA"],
    )