MCPcopy Index your code

hub / github.com/ARC-MX/sgcc_electricity_new / functions

Functions116 in github.com/ARC-MX/sgcc_electricity_new

↓ 19 callersFunction_safe_float
(value: Any, default: Optional[float] = None)
scripts/vue_state.py:199
↓ 16 callersMethod_click_button
封装点击函数,仅在元素可点击时点击
scripts/data_fetcher.py:66
↓ 13 callersFunction_find_element
(driver: WebDriver, selector: str, wait: float = 1.0)
scripts/captcha_selenium.py:504
↓ 11 callersFunction_first_data_value
(components: list[dict[str, Any]], key: str)
scripts/vue_state.py:149
↓ 6 callersMethodsend_url
(self, sensorName, request_body)
scripts/sensor_updator.py:357
↓ 6 callersMethodshould_update
(self, sensor_name, new_state, check_attributes=None)
scripts/sensor_updator.py:141
↓ 5 callersFunction_refresh_captcha
刷新验证码(多策略回退,参照 ha-95598)。
scripts/captcha_selenium.py:602
↓ 4 callersMethod_random_delay
添加随机延迟,使自动化操作更难被检测。
scripts/data_fetcher.py:251
↓ 3 callersFunction_detect_captcha_type_js
使用 JS 注入检测验证码类型(参考 ha-95598 get_info 方法)。 遍历 iframe 查找可见的提示文本和DOM特征。
scripts/captcha_selenium.py:419
↓ 2 callersMethod__handle_error
error 参数当前未使用,保留以备将来使用。
scripts/error_watcher.py:98
↓ 2 callersFunction_check_passed
(driver: WebDriver, selectors: dict)
scripts/captcha_selenium.py:583
↓ 2 callersMethod_choose_current_userid
切换到指定索引的用户户号
scripts/data_fetcher.py:358
↓ 2 callersMethod_download
下载图片,支持 http 和 data URI。
scripts/click_captcha_solver.py:74
↓ 2 callersMethod_get_cache_file
(self)
scripts/sensor_updator.py:60
↓ 2 callersMethod_get_current_userid
读取当前页面的用户户号(兼容多种页面布局)
scripts/data_fetcher.py:328
↓ 2 callersMethod_get_error_message
获取错误信息,如果不存在则返回 None
scripts/data_fetcher.py:186
↓ 2 callersFunction_get_image_size_from_url
(url: str)
scripts/captcha_selenium.py:397
↓ 2 callersMethod_login
(self, driver, phone_code = False)
scripts/data_fetcher.py:107
↓ 2 callersFunction_normalize_daily_row
(row: dict[str, Any])
scripts/vue_state.py:175
↓ 2 callersFunction_normalize_ym
(value: Any)
scripts/vue_state.py:190
↓ 2 callersFunction_solve_slider
使用LLM解算滑块验证码:识别缺口位置 → 模拟拖拽。
scripts/captcha_selenium.py:199
↓ 2 callersMethodinstance
(cls)
scripts/error_watcher.py:28
↓ 2 callersMethodupdate_month_data
(self, postfix: str, sensorState: float, usage=False)
scripts/sensor_updator.py:220
↓ 2 callersMethodupdate_one_userid
(self, user_id: str, balance: float, last_daily_date: str, last_daily_usage: float, yearly_charge: float, year
scripts/sensor_updator.py:31
↓ 2 callersMethodupdate_yearly_data
(self, postfix: str, sensorState: float, usage=False)
scripts/sensor_updator.py:250
↓ 1 callersFunction_click_with_actions
使用 ActionChains 点击(主方法,参照 ha-95598)。
scripts/captcha_selenium.py:555
↓ 1 callersFunction_data_values
(components: list[dict[str, Any]], key: str)
scripts/vue_state.py:157
↓ 1 callersFunction_detect_captcha_type_fallback
回退检测方法(HTML文本扫描)。
scripts/captcha_selenium.py:473
↓ 1 callersFunction_extract_main_url
提取主图的 URL 及尺寸。
scripts/captcha_selenium.py:353
↓ 1 callersFunction_extract_ref_url
提取参考图标条的图片 URL。
scripts/captcha_selenium.py:342
↓ 1 callersMethod_fallback_login
使用备用方案登录
scripts/data_fetcher.py:198
↓ 1 callersMethod_find_all_icons
单次API调用,带链式思考提示,让LLM找到所有3个图标。
scripts/click_captcha_solver.py:117
↓ 1 callersFunction_find_main_image_element
找到用于坐标转换的可见图片元素。优先宽高比与主图匹配的元素。
scripts/captcha_selenium.py:513
↓ 1 callersMethod_get_all_data
(self, driver, user_id, userid_index)
scripts/data_fetcher.py:408
↓ 1 callersMethod_get_bill_detail
从用电量页面通过 Vue state 获取月度分时电量
scripts/data_fetcher.py:814
↓ 1 callersMethod_get_daily_usage_data
获取每日用电量数据 (7天或30天),通过 radio 按钮切换,失败时返回空列表
scripts/data_fetcher.py:713
↓ 1 callersMethod_get_electric_balance
(self, driver)
scripts/data_fetcher.py:599
↓ 1 callersMethod_get_month_usage
获取每月用电量
scripts/data_fetcher.py:678
↓ 1 callersMethod_get_user_ids
获取用户 ID 列表。优先从 el-dropdown 获取(余额页面), 失败则从 el-select 获取(用电量页面),最后从页面源码正则匹配。
scripts/data_fetcher.py:519
↓ 1 callersMethod_get_visible_user_options
获取可见的用户下拉选项(兼容 el-dropdown 和 el-select)
scripts/data_fetcher.py:393
↓ 1 callersMethod_get_webdriver
(self)
scripts/data_fetcher.py:78
↓ 1 callersMethod_get_yearly_data
(self, driver)
scripts/data_fetcher.py:627
↓ 1 callersMethod_get_yesterday_usage
获取最近一次用电量
scripts/data_fetcher.py:660
↓ 1 callersMethod_inference
(self,image)
scripts/onnx.py:211
↓ 1 callersMethod_init_balance_notify
(self)
scripts/sensor_updator.py:19
↓ 1 callersMethod_init_db
(self)
scripts/data_fetcher.py:51
↓ 1 callersFunction_normalize_usage_month
(row: dict[str, Any])
scripts/vue_state.py:161
↓ 1 callersMethod_parse_coordinates
从LLM返回文本中解析坐标并转为像素。
scripts/click_captcha_solver.py:161
↓ 1 callersMethod_qr_login
(self, driver)
scripts/data_fetcher.py:205
↓ 1 callersFunction_save_debug_images
(ref_url: str, main_url: str)
scripts/captcha_selenium.py:381
↓ 1 callersMethod_save_to_cache
(self, user_id, balance, last_daily_date, last_daily_usage, yearly_charge, yearly_usage, month_charge, month_u
scripts/sensor_updator.py:64
↓ 1 callersMethod_save_user_data
(self, user_id, balance, enhanced_balance, last_daily_date, last_daily_usage,
scripts/data_fetcher.py:832
↓ 1 callersFunction_simulate_drag
模拟人类拖拽滑块,分段移动 + 随机停顿。
scripts/captcha_selenium.py:311
↓ 1 callersMethod_split_strip
将参考图标条三等分为独立图标的 data URI。
scripts/click_captcha_solver.py:92
↓ 1 callersMethod_update_tou_sensors
更新月度分时电量传感器(谷/平/峰/尖)
scripts/sensor_updator.py:280
↓ 1 callersFunction_wait_for_captcha
(driver: WebDriver, selectors: dict, timeout: int)
scripts/captcha_selenium.py:491
↓ 1 callersMethod_watch_impl
(self, func, *args, **options)
scripts/error_watcher.py:90
↓ 1 callersMethodclose_connect
(self)
scripts/db.py:17
↓ 1 callersMethodconnect_user_db
(self, user_id)
scripts/db.py:8
↓ 1 callersMethodconnect_user_db
(self, user_id)
scripts/db.py:86
↓ 1 callersMethodcreate_tabe
(self, user_id)
scripts/db.py:111
↓ 1 callersMethoddraw
(self,image, box_data)
scripts/onnx.py:98
↓ 1 callersMethodfetch
主逻辑
scripts/data_fetcher.py:257
↓ 1 callersMethodget_boxes
(self, prediction, confidence_threshold=0.7, nms_threshold=0.6)
scripts/onnx.py:124
↓ 1 callersFunctionget_data_dir
获取数据存储目录:Docker 用 /data,本地用项目下的 data/
scripts/const.py:32
↓ 1 callersMethodget_distance
(self,image,draw=False)
scripts/onnx.py:225
↓ 1 callersMethodget_sensor_state
(self, sensor_name)
scripts/sensor_updator.py:126
↓ 1 callersMethodinit
初始化 ErrorWatcher 单例实例。 在使用 ErrorWatcher 之前应先调用此方法。 可接受以下关键字参数: - root_dir: 保存截图的根目录(默认为当前工作目录)。 - screenshot_
scripts/error_watcher.py:14
↓ 1 callersMethodinsert_data
(self, data:dict)
scripts/db.py:138
↓ 1 callersMethodinsert_expand_data
(self, data:dict)
scripts/db.py:155
↓ 1 callersFunctionlogger_init
(level: str)
scripts/main.py:95
↓ 1 callersFunctionmain
()
scripts/main.py:15
↓ 1 callersMethodnms
(self,dets, thresh)
scripts/onnx.py:53
↓ 1 callersMethodrepublish
(self)
scripts/sensor_updator.py:100
↓ 1 callersFunctionrun_task
(data_fetcher: DataFetcher)
scripts/main.py:86
↓ 1 callersMethodset_driver
设置用于截图的驱动。
scripts/error_watcher.py:59
↓ 1 callersMethodsolve
下载图片 → 拆分参考条 → 单次LLM调用找到所有3个图标。
scripts/click_captcha_solver.py:46
↓ 1 callersFunctionsolve_captcha_in_browser
在浏览器中处理验证码,返回是否通过。
scripts/captcha_selenium.py:62
↓ 1 callersMethodupdate_balance
(self, postfix: str, sensorState: float, enhanced_balance: dict = None)
scripts/sensor_updator.py:192
↓ 1 callersMethodupdate_last_daily_usage
(self, postfix: str, last_daily_date: str, sensorState: float)
scripts/sensor_updator.py:170
↓ 1 callersMethodupdate_prepay_balance
更新预付费余额传感器
scripts/sensor_updator.py:335
↓ 1 callersMethodxywh2xyxy
(self,x)
scripts/onnx.py:42
Method__call__
(self, user_id, balance)
scripts/notify.py:9
Method__call__
(self, user_id, balance)
scripts/notify.py:27
Method__call__
(self, qrcode)
scripts/notify.py:42
Method__init__
(self, **kwargs)
scripts/error_watcher.py:81
Method__init__
(self,onnx_file_name="captcha.onnx")
scripts/onnx.py:14
Method__init__
(self)
scripts/sensor_updator.py:12
Method__init__
(self, api_key: Optional[str] = None, model: Optional[str] = None,
scripts/click_captcha_solver.py:29
Method__init__
(self, username: str, password: str)
scripts/data_fetcher.py:28
Function_detect_captcha_type
检测验证码类型(兼容旧接口,委托给JS检测)。
scripts/captcha_selenium.py:414
Method_get_daily_tou_data
通过展开日用电量表格行获取每日分时电量(谷/平/峰/尖)
scripts/data_fetcher.py:771
Methodclient
(self)
scripts/click_captcha_solver.py:39
Methodclose_connect
(self)
scripts/db.py:79
Methodclose_connect
(self)
scripts/db.py:172
Methodconnect_user_db
创建数据库集合,db_name = electricity_daily_usage_{user_id} :param user_id: 用户ID
scripts/db.py:22
Methoddecorator
(f)
scripts/error_watcher.py:45
Methodget_result
(self,class_scores)
scripts/onnx.py:32
Methodinsert_data
(self, data:dict)
scripts/db.py:11
Methodinsert_data
(self, data:dict)
scripts/db.py:55
next →1–100 of 116, ranked by callers