Skip to content

Commit

Permalink
adds exclude filter to cable channel info parsing #100
Browse files Browse the repository at this point in the history
  • Loading branch information
bb-Ricardo committed Mar 20, 2023
1 parent 06f5aae commit 10d7288
Showing 1 changed file with 44 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ def prepare_json_response_data(response):
"value_function": lambda data: data.get("type"),
"tags_function": lambda data: {"id": data.get("channelID")}
},
"exclude_filter_function": lambda data: "docsis31" not in grab(data, "data.channelDs",
fallback={}).keys()
},
"cable_channel_ds_docsis31_power_level": {
"data_path": "data.channelDs.docsis31",
Expand All @@ -126,6 +128,8 @@ def prepare_json_response_data(response):
"value_function": lambda data: data.get("powerLevel"),
"tags_function": lambda data: {"id": data.get("channelID")}
},
"exclude_filter_function": lambda data: "docsis31" not in grab(data, "data.channelDs",
fallback={}).keys()
},
"cable_channel_ds_docsis31_channel": {
"data_path": "data.channelDs.docsis31",
Expand All @@ -135,6 +139,8 @@ def prepare_json_response_data(response):
"value_function": lambda data: data.get("channel"),
"tags_function": lambda data: {"id": data.get("channelID")}
},
"exclude_filter_function": lambda data: "docsis31" not in grab(data, "data.channelDs",
fallback={}).keys()
},
"cable_channel_ds_docsis31_frequency": {
"data_path": "data.channelDs.docsis31",
Expand All @@ -144,6 +150,8 @@ def prepare_json_response_data(response):
"value_function": lambda data: data.get("frequency"),
"tags_function": lambda data: {"id": data.get("channelID")}
},
"exclude_filter_function": lambda data: "docsis31" not in grab(data, "data.channelDs",
fallback={}).keys()
},
"cable_channel_ds_docsis30_type": {
"data_path": "data.channelDs.docsis30",
Expand All @@ -153,6 +161,8 @@ def prepare_json_response_data(response):
"value_function": lambda data: data.get("type"),
"tags_function": lambda data: {"id": data.get("channelID")}
},
"exclude_filter_function": lambda data: "docsis30" not in grab(data, "data.channelDs",
fallback={}).keys()
},
"cable_channel_ds_docsis30_power_level": {
"data_path": "data.channelDs.docsis30",
Expand All @@ -162,6 +172,8 @@ def prepare_json_response_data(response):
"value_function": lambda data: data.get("powerLevel"),
"tags_function": lambda data: {"id": data.get("channelID")}
},
"exclude_filter_function": lambda data: "docsis30" not in grab(data, "data.channelDs",
fallback={}).keys()
},
"cable_channel_ds_docsis30_channel": {
"data_path": "data.channelDs.docsis30",
Expand All @@ -171,6 +183,8 @@ def prepare_json_response_data(response):
"value_function": lambda data: data.get("channel"),
"tags_function": lambda data: {"id": data.get("channelID")}
},
"exclude_filter_function": lambda data: "docsis30" not in grab(data, "data.channelDs",
fallback={}).keys()
},
"cable_channel_ds_docsis30_frequency": {
"data_path": "data.channelDs.docsis30",
Expand All @@ -180,6 +194,8 @@ def prepare_json_response_data(response):
"value_function": lambda data: data.get("frequency"),
"tags_function": lambda data: {"id": data.get("channelID")}
},
"exclude_filter_function": lambda data: "docsis30" not in grab(data, "data.channelDs",
fallback={}).keys()
},
"cable_channel_ds_docsis30_latency": {
"data_path": "data.channelDs.docsis30",
Expand All @@ -189,6 +205,8 @@ def prepare_json_response_data(response):
"value_function": lambda data: data.get("latency"),
"tags_function": lambda data: {"id": data.get("channelID")}
},
"exclude_filter_function": lambda data: "docsis30" not in grab(data, "data.channelDs",
fallback={}).keys()
},
"cable_channel_ds_docsis30_mse": {
"data_path": "data.channelDs.docsis30",
Expand All @@ -198,6 +216,8 @@ def prepare_json_response_data(response):
"value_function": lambda data: data.get("mse"),
"tags_function": lambda data: {"id": data.get("channelID")}
},
"exclude_filter_function": lambda data: "docsis30" not in grab(data, "data.channelDs",
fallback={}).keys()
},
"cable_channel_ds_docsis30_corrected_errors": {
"data_path": "data.channelDs.docsis30",
Expand All @@ -207,6 +227,8 @@ def prepare_json_response_data(response):
"value_function": lambda data: data.get("corrErrors"),
"tags_function": lambda data: {"id": data.get("channelID")}
},
"exclude_filter_function": lambda data: "docsis30" not in grab(data, "data.channelDs",
fallback={}).keys()
},
"cable_channel_ds_docsis30_non_corrected_errors": {
"data_path": "data.channelDs.docsis30",
Expand All @@ -216,6 +238,8 @@ def prepare_json_response_data(response):
"value_function": lambda data: data.get("nonCorrErrors"),
"tags_function": lambda data: {"id": data.get("channelID")}
},
"exclude_filter_function": lambda data: "docsis30" not in grab(data, "data.channelDs",
fallback={}).keys()
},
"cable_channel_us_docsis31_type": {
"data_path": "data.channelUs.docsis31",
Expand All @@ -225,6 +249,8 @@ def prepare_json_response_data(response):
"value_function": lambda data: data.get("type"),
"tags_function": lambda data: {"id": data.get("channelID")}
},
"exclude_filter_function": lambda data: "docsis31" not in grab(data, "data.channelUs",
fallback={}).keys()
},
"cable_channel_us_docsis31_power_level": {
"data_path": "data.channelUs.docsis31",
Expand All @@ -234,6 +260,8 @@ def prepare_json_response_data(response):
"value_function": lambda data: data.get("powerLevel"),
"tags_function": lambda data: {"id": data.get("channelID")}
},
"exclude_filter_function": lambda data: "docsis31" not in grab(data, "data.channelUs",
fallback={}).keys()
},
"cable_channel_us_docsis31_channel": {
"data_path": "data.channelUs.docsis31",
Expand All @@ -243,6 +271,8 @@ def prepare_json_response_data(response):
"value_function": lambda data: data.get("channel"),
"tags_function": lambda data: {"id": data.get("channelID")}
},
"exclude_filter_function": lambda data: "docsis31" not in grab(data, "data.channelUs",
fallback={}).keys()
},
"cable_channel_us_docsis31_frequency": {
"data_path": "data.channelUs.docsis31",
Expand All @@ -252,6 +282,8 @@ def prepare_json_response_data(response):
"value_function": lambda data: data.get("frequency"),
"tags_function": lambda data: {"id": data.get("channelID")}
},
"exclude_filter_function": lambda data: "docsis31" not in grab(data, "data.channelUs",
fallback={}).keys()
},
"cable_channel_us_docsis31_multiplex": {
"data_path": "data.channelUs.docsis31",
Expand All @@ -261,6 +293,8 @@ def prepare_json_response_data(response):
"value_function": lambda data: data.get("multiplex"),
"tags_function": lambda data: {"id": data.get("channelID")}
},
"exclude_filter_function": lambda data: "docsis31" not in grab(data, "data.channelUs",
fallback={}).keys()
},
"cable_channel_us_docsis30_type": {
"data_path": "data.channelUs.docsis30",
Expand All @@ -270,6 +304,8 @@ def prepare_json_response_data(response):
"value_function": lambda data: data.get("type"),
"tags_function": lambda data: {"id": data.get("channelID")}
},
"exclude_filter_function": lambda data: "docsis30" not in grab(data, "data.channelUs",
fallback={}).keys()
},
"cable_channel_us_docsis30_power_level": {
"data_path": "data.channelUs.docsis30",
Expand All @@ -279,6 +315,8 @@ def prepare_json_response_data(response):
"value_function": lambda data: data.get("powerLevel"),
"tags_function": lambda data: {"id": data.get("channelID")}
},
"exclude_filter_function": lambda data: "docsis30" not in grab(data, "data.channelUs",
fallback={}).keys()
},
"cable_channel_us_docsis30_channel": {
"data_path": "data.channelUs.docsis30",
Expand All @@ -288,6 +326,8 @@ def prepare_json_response_data(response):
"value_function": lambda data: data.get("channel"),
"tags_function": lambda data: {"id": data.get("channelID")}
},
"exclude_filter_function": lambda data: "docsis30" not in grab(data, "data.channelUs",
fallback={}).keys()
},
"cable_channel_us_docsis30_frequency": {
"data_path": "data.channelUs.docsis30",
Expand All @@ -297,6 +337,8 @@ def prepare_json_response_data(response):
"value_function": lambda data: data.get("frequency"),
"tags_function": lambda data: {"id": data.get("channelID")}
},
"exclude_filter_function": lambda data: "docsis30" not in grab(data, "data.channelUs",
fallback={}).keys()
},
"cable_channel_us_docsis30_multiplex": {
"data_path": "data.channelUs.docsis30",
Expand All @@ -306,6 +348,8 @@ def prepare_json_response_data(response):
"value_function": lambda data: data.get("multiplex"),
"tags_function": lambda data: {"id": data.get("channelID")}
},
"exclude_filter_function": lambda data: "docsis30" not in grab(data, "data.channelUs",
fallback={}).keys()
},
}
}
Expand Down

0 comments on commit 10d7288

Please sign in to comment.