Lenovo Vibe P1 display toggles on and off while charging
This is not a solution to fix your device problem. It is a workaround only to keep your screen off, while charging

Automation is the preferred option. Many apps are available. I prefer using MacroDroid , since it is free (upto 5 macros) and easy to learn. To understand how MacroDroid works and required settings,  my answer here



Your macro would look like this


Macro : Screen Off (name of macro )


Trigger: 

Power Connected 

Action: 

Screen On/Off &rarr;  Screen Off 

Constraints: None (leave blank)