Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
A simple Pythonic wrapper around the ChargePoint EV Charging Network API.
I, nor this project, are in any way associated with ChargePoint. Use this project at your own risk. ChargePoint is a registered trademark of ChargePoint, Inc.
I just wanted a way to retrieve and store charging data from my ChargePoint Home Flex in a way that is easy to model and query. This project is the first step in getting that data into a more robust time series database.
from python_chargepoint import ChargePoint
client = ChargePoint(username="user", password="password")
print(client.user_id)
# 1234567890
from python_chargepoint import ChargePoint
client = ChargePoint(username="user", password="password")
chargers = client.get_home_chargers()
print(chargers)
# [12345678]
for charger_id in chargers:
charger = client.get_home_charger_status(charger_id=charger_id)
print(charger)
# HomeChargerStatus(
# brand='CP',
# plugged_in=True,
# connected=True,
# charging_status='NOT_CHARGING',
# last_connected_at=datetime.datetime(2022, 1, 30, 15, 14, 36),
# reminder_enabled=False,
# reminder_time='21:00',
# model='CPH50-NEMA6-50-L23',
# mac_address='0024B10000012345',
# amperage_limit=25,
# possible_amperage_limits=[20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32])
from python_chargepoint import ChargePoint
client = ChargePoint(username="user", password="password")
charging = client.get_user_charging_status()
if charging:
print(charging)
# UserChargingStatus(
# session_id=1234567890,
# start_time=datetime.datetime(2022, 1, 30, 13, 32, 45),
# state='fully_charged',
# stations=[
# ChargePointStation(
# id=12345678,
# name='CP HOME ',
# latitude=30.0000000,
# longitude=-90.0000000)
# ])
session = client.get_charging_session(charging.session_id)
print(session)
# ChargingSession(
# session_id=1234567890,
# start_time=datetime.datetime(2022, 1, 30, 13, 32, 45),
# device_id=12345678,
# device_name='CP HOME',
# charging_state='fully_charged',
# charging_time=2426000,
# energy_kwh=4.3404,
# miles_added=15.024461538461539,
# miles_added_per_hour=0.0,
# outlet_number=1,
# port_level=2,
# power_kw=0.0,
# purpose='PERSONAL',
# currency_iso_code='USD',
# payment_completed=True,
# payment_type='none',
# pricing_spec_id=0,
# total_amount=0.67,
# api_flag=False,
# enable_stop_charging=True,
# has_charging_receipt=False,
# has_utility_info=True,
# is_home_charger=True,
# is_purpose_finalized=True,
# last_update_data_timestamp=datetime.datetime(2022, 1, 30, 15, 12, 48),
# stop_charge_supported=True,
# company_id=12345,
# company_name='CP Home',
# latitude=30.0000000,
# longitude=-90.0000000,
# address='Home Charger',
# city='City',
# state_name='State',
# country='United States',
# zipcode='12345',
# update_data=[
# ChargingSessionUpdate(
# energy_kwh=0.0,
# power_kw=0.0002,
# timestamp=datetime.datetime(2022, 1, 30, 13, 32, 57)),
# ChargingSessionUpdate(
# energy_kwh=0.0001,
# power_kw=0.1568,
# timestamp=datetime.datetime(2022, 1, 30, 13, 33, 9)),
# ChargingSessionUpdate(
# energy_kwh=0.0025,
# power_kw=3.7337,
# timestamp=datetime.datetime(2022, 1, 30, 13, 33, 12)),
# ChargingSessionUpdate(
# energy_kwh=0.0161,
# power_kw=1.3854,
# timestamp=datetime.datetime(2022, 1, 30, 13, 33, 33)),
# ...],
# update_period=300000,
# utility=PowerUtility(
# id=0,
# name='Energy Company',
# plans=[
# PowerUtilityPlan(
# code='R',
# id=12345,
# is_ev_plan=False,
# name='Residential')
# ]))
from python_chargepoint import ChargePoint
client = ChargePoint(username="user", password="password")
charging = client.get_user_charging_status()
if charging:
session = client.get_charging_session(charging.session_id)
session.stop()
# If you wanted to charge again, you can start a new session.
session = client.start_charging_session(session.device_id)
You can also start a new session by providing any device ID you want to start charging on.
from python_chargepoint import ChargePoint
client = ChargePoint(username="user", password="password")
home_flex_id = client.get_home_chargers()[0]
home_flex = client.get_home_charger_status(home_flex_id)
if home_flex.charging_status == "AVAILABLE":
session = client.start_charging_session(home_flex_id)
from python_chargepoint import ChargePoint
client = ChargePoint(username="user", password="password")
home_flex_id = client.get_home_chargers()[0]
# Print out valid amperage values.
print(client.get_home_charger_status(home_flex_id).possible_amperage_limits)
# [20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]
client.set_amperage_limit(home_flex_id, 23)
print(client.get_home_charger_status(home_flex_id).amperage_limit)
# 23
FAQs
A simple, Pythonic wrapper for the ChargePoint API.
We found that python-chargepoint demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.